-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add argument matcher for expecting a block. #1237
base: main
Are you sure you want to change the base?
Conversation
Some further improvements could be made here,what happens when used positionally? and does it always mean the supplied |
My only use case was to do something like |
@ioquatix We already have that, it's called |
For some reason I couldn't find this initially... I did look for it! |
Maybe we can say this is good enough for a first step? Ready the tests I found it already a good improvement. Good job |
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.
LGTM
Thanks so much! |
A quick question - IMO ArgumentListMatcher and associated code could use a little refactoring to better express intent, and to include blocks in the args verification in a more consistent way (that's one of the reasons I stopped at a_block). I'm happy to attempt this if it makes sense to do so, and of course, it goes without saying that I'll keep the changes small, and will completely understand if they are rejected. Would that be useful? |
You are welcome to have a go at refactoring it if you think you can make it better, please make sure you understand the matcher protocol before changing method names, e.g. it's important and non optional that Thinking about this, theres now ambiguity as to what we mean when, @myronmarston I'm leaning towards adding |
Procs/Lambdas as an argument and blocks are different things. I suggest consider |
@JonRowe yep, well noted, I will keep that in mind. Yep agree that bound and unbound blocks be treated differently. I was unaware of |
They're not different enough, and can be passed around... Consider:
|
@JonRowe @benoittgt @ioquatix Working toward treating args and blocks in a more similar manner, I've done some work to try to tease out |
* cucumber feature passing * happy path unit specs passing * need help fixing sad path unit specs, currently marked pending
034a81b
to
96feb55
Compare
This is @kaiwren's
a_block
argument matcher with fleshed out sad path specs, and a refactoring of the match logic to allow mixing with other arguments. Review please @kaiwren @ioquatix @benoittgt.