5 kyu

There are two kinds of people

109 of 142joh_pot
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar

    The description formatting is broken.

  • user9644768 Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

  • narayanswa30663 Avatar

    This comment has been hidden.

  • narayanswa30663 Avatar

    Functions that return lambdas should be allowed in Ruby as per the description and basic cases, but the full tests expect a hash.

  • Voile Avatar

    If anything can be returned then Test.expect in fixed tests is a bad choice because it doesn't test the keys actually exist, it only tests if the final value is truthy. So if I returned 0/false/'' (or even undefined, because I can!) in the last step they'll fail the fixed tests.

    And if you allow literally anything, here's a much bigger problem: tests of the form .there().are().two().kinds().of().people().apparently() (with additional, invalid calls after the intended line). In this case what exactly is expected? If you don't constrict what the return value from the last call is, this is undefined behaviour.

  • Voile Avatar

    Test.expect is used in JS version, which means it's crap: any truthy value passes all the tests. Nothing is enforced at all.

  • Voile Avatar

    Test.expect is used in JS version, which means it's crap: any truthy value passes all the tests. Nothing is enforced at all.

  • Voile Avatar

    Edge case '' (empty string) missing.

  • Voile Avatar

    There are also no tests on whether the correct keys are enforced, or whether things will not break if you use many instances at the same time.

    I'll just rewrite the tests myself.

  • Voile Avatar

    JS and Ruby have completely different requirements: JS expects functionator('there are two kinds of people').there().are().two().kinds().of().people() === true while Ruby expects functionator("there are two kinds of people")["there"]["are"]["two"]["kinds"]["of"]["people"] == true, and only the behaviour of JS version is mentioned in the descriptions.

  • narayanswa30663 Avatar

    This comment has been hidden.

  • shaozhan2004@126.com Avatar

    not sure what does this mentions: "Please note that these chainable calls do not return the current object"

    always failed as following: symucxkj() should not exist in same object as xdtrlqbx(). Chainable calls should not return current object! - Expected: true, instead got: false

  • Voile Avatar

    Approved

  • JohanWiltink Avatar

    In the description, a mention of the expected final function value (i.e. true) would be nice.

  • Voile Avatar

    Another thing: Did you disabled the Function.prototype.toString method? Because for some reason trying to use toString on every function in this kata gives an empty string, even for native functions.

  • Voile Avatar

    Random tests are always broken.

    hfllhelw badlqevl estahoqd krgmkupu wwiwqrkm hpsuxmcu edmmjbdm eocwyzzd whmxywbw zmfsqwcg mngmdtzp ctnepaqz ftouvxaw jeugwinl jfjobomc enulcein pnskulbi fhgqzwzr lwexnhyw tbymsgaj hbaeuall biuvttqi vjcroxrl
    
    function hfllhelw() has not been found - Expected: true, instead got: false
    

    It appears that it's not even calling the first function correctly.