-
-
Notifications
You must be signed in to change notification settings - Fork 394
Give users an error when they use a value matcher in a block expectation expression #530
Conversation
/cc @JonRowe @cupakromer |
class ExpectationTarget | ||
# @private | ||
# Used as a sentinel value to be able to tell when the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never heard the term "sentinel value" before, I like it.
OK, I refactored based on @JonRowe's suggestion. Still have a couple more TODOs (see above). |
Hmm, I'm actually wondering if RSpec::Matchers.define :match_a_block do
match { ... }
supports_block_expectations
end Also, Any preference? |
I'm ok with |
Agree, 👍 for |
This is used to give users a clear error when they wrongly use a value matcher against a block, expecting it to match against the return value of the block: expect { 3 }.to eq(3)
OK, I think this is ready to go (except for the 2.99 deprecation)....care to rereview? |
LGTM |
Give users an error when they use a value matcher in a block expectation expression
…a block (more information: rspec/rspec-expectations#530)
Start of fix for #526.