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.
Sample tests should include case where numbers are diffent, but they're both either odd or even.
For instance Ruby:
Test.assert_equals(lovefunc(7,5), false)
or
Test.assert_equals(lovefunc(6,8), false)
Sample tests are passable with simple "value1 != value2", although they obviously fails the attempt and they would also fail if any of two examples above would be added.
Ah, I never seen on CodeWars sample tests that wouldn't work, so somehow I didn't even dare to attempt without passing sample tests, but my code of course worked when I used it to pass the challenge.
I didn't use method "add" in my code so why am I getting error "undefined methord add"?
It seems like tests in Ruby are not working correctly? My code works in REPL(IRB) and I checked Ruby documentation for 2.5.0 that includes code I've used. So following error message seems to come from incorrect tests - "undefined method 'add'"?
#<NoMethodError: undefined method
add' for main:Object> main.rb:12:in
block (2 levels) in '/runner/frameworks/ruby/cw-2.rb:180:in
wrap_error' /runner/frameworks/ruby/cw-2.rb:72:in
it'/runner/frameworks/ruby/cw-2.rb:206:in
it' main.rb:11:in
block in '/runner/frameworks/ruby/cw-2.rb:55:in
block in describe' /runner/frameworks/ruby/cw-2.rb:46:in
measure'/runner/frameworks/ruby/cw-2.rb:51:in
describe' /runner/frameworks/ruby/cw-2.rb:202:in
describe'main.rb:10:in `'
This comment is hidden because it contains spoiler information about the solution