Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Oh well, my bad, sorry. Didn't think Codewars is using a custom test framework.
According to https://github.com/Codewars/kata-test-framework-ruby/blob/master/framework.rb#L147 real order is
actual, expected
, so you're right.Now I'm curious why is it implemented this way.
Just checked the order of arguments passed in in the Codewars Ruby test fixture;
actual, expected
is the correct order (in Codewars).Thanks for the info khovansky-al - I am no expert in Ruby (both inside and outside of Codewars) so I wasn't very sure of the order of arguments passed in.
I will make sure I pass in the values in the correct order next time I author a Ruby kata :)
EDIT: Wait khovansky-al, are you sure the test fixture you are referring to in the article is the test fixture used in Codewars?
According to rubydocs, it is not. http://ruby-doc.org/stdlib-2.1.0/libdoc/test/unit/rdoc/Test/Unit/Assertions.html#method-i-assert_equal
Correct order is
expected, actual
.In Java (and possibly a few other languages) the correct order is
expected, actual
but in Ruby I think the correct order isactual, expected
.As a side note, if over 500 people have completed a Kata (as in this case), the author of the Kata can no longer modify the test cases so raising an issue regarding the test cases is useless at this stage.
That is the user's fault, not the author's. By default, if the Kata does not ask the user to modify the original input passed in, the user is expected to leave the original input intact.