Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This effectively ran the following code:
The optional argument to
Proc#curry
is the arity of the curried proc. In other words: if the curried proc gets called with at least 1 argument, which means the value oftmp
in this example will be equal to@proc_add[1,2]
, the result is an Integer and not a new proc object.The example with a lambda would raise the error in the
curry(1)[1,2]
part, so the second test was pretty much the same as the first test.The old code did pass, because the failing spec was wrapped in a block that should not raise an error. This was indented with a new line after the
should_not
, which is then seen by Ruby as two separate statements. The block with the failing spec then never gets executed. This looks like the only location in the specs whereshould
orshould_not
is the last code on a line.