Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I have a small suggestion to make the kata's Test and Attempts failed test results a bit more clear.
    Instead of printing "Nope!", I would suggest to print a message giving a hint about the method name and the passed arguments of each test.

    E.g.:

    Let's imagine that the the second test of Test failed.

    Current test and failure message:

    Test.expect(lt.get_points("Man Utd") == 3, "Nope!")
    
     Nope! -  Expected: 3, instead got: 0
    

    Suggested test/failure message:

    Test.expect(lt.get_points("Man Utd") == 3, "Wrong number of points for Man Utd.")
    
    Wrong number of points for Man Utd. -  Expected: 3, instead got: 0
    
  • Custom User Avatar

    Thanks for your prompt answer.
    I will follow the guidelines and ask a question about this kata, if it still make sense to ask it after my code recheck.

    [EDIT] it was definitely my code, sorry for this and thanks again for your support.

  • Custom User Avatar

    The "Attempt" tests don't seem to work from Test.expect(lt.get_points("Liverpool") == 1, "Nope!")
    My code seems to work okay for the full test scenario (I called each method manually and checked the result), but I don't pass the above test, frustating :P
    Can you recheck your test and correct if necessary?

    Above test error message:

    Man Utd should now have 1 win, 1 draw and 0 losses.
    Nope! -  Expected: 1, instead got: nil
    

    And below my test results for each method:

    Test Results:
     Log
    3
    3
    0
    0
    3
    -3
    4
    4
    1  #=> this is the result of the methid call that return "nil" according the above error message, as you can see, it definitely returns 1!
    1
    4
    -3
    
  • Custom User Avatar

    It looks like the random test expected results are not sorted in ascending order of values in the Ruby version.
    Here is a test log I got:

    Random Tests
      Expected: [[25, 27], [626, 628], [271, 273], [359, 361]], instead got: [[25, 27], [271, 273], [359, 361], [626, 628]]
      Expected: [[229, 231], [891, 893], [827, 829], [57, 59], [329, 331], [854, 856], [227, 229], [893, 895], [802, 804], [510, 512]], instead got: [[57, 59], [227, 229], [229, 231], [329, 331], [510, 512], [802, 804], [827, 829], [854, 856], [891, 893], [893, 895]] 
    

    Can we correct them?