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.
Ok I'll add that. Done.
I think cause when I was writing it, my mindset was on expected should always = output of the method.
which is why I was surprised to see Expected = the original input cause my mind was like
"But the whole point of the method is to remove the smallest number!" that's why
Current test message:
You've mutated input array
Wonder if this will be clearer?
You've mutated input array (expectation assertion is on value of input array, not output of method)
What's your suggestion? As you can see:
Maybe the test expectation message can be more accurate? I thought the expectation was the output of the method, which was what confused me.
ahh right thanks - i took that to mean don't mutate the order
It seems you didn't read/understood this part of the instructions:
That test is only for testing input mutation, it's not like the others.
Sorry should have been clearer - this is with the mutations to original array test
What I don't understand is: If the direct input is [147, 376, 340, 233, 281, 322, 132, 128], I would expect the smallest number '128' to be removed - but it seems the expectation does not expect this
The ruby code is fine. I ran this to check the functionality as described.:
And the results show that the input is not
exactly the same as the expected output
:Also, take note that there are
2,661 solutions
in ruby for this kata, so any such bug would have been discovered long ago.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution