-
-
Notifications
You must be signed in to change notification settings - Fork 397
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 'thrice' expectation. #615
Conversation
"Thrice" appears in the famous poem, Kubla Khan, by Samuel Taylor Coleridge. This alone should justify inclusion. More generally, 'thrice' is an excellent word. |
if we're going to add this we should have parity with rspec-mocks: |
Note that the Travis failure appears to be unrelated to this change; it's an error that only occurred in the Ruby 2.1.1 build and which I cannot duplicate, even with the same seed. |
I'm not a big fan of this. That said, I can live with it. I've just never been much of a fan of the whole add numeric method names idea, unless it really made a lot of sense. I've seen / used |
Maybe we should also add |
Like @cupakromer I'm slightly 👎 on this, I don't like wordy additions like this either as it inevitably leads to bloat, there's always just one more, where do you draw the line? |
I'm 👍 on this. Given that we have
I think there's a natural line after |
If we're going to include twice we should include thrice. (I don't think we should include either, but w/e.) |
If we're going to be consistent, also need Should add beside Needs changelog entry. |
We don't have a |
I'm sorry, I misread my grep, didn't see it was defined in the feature itself. Move along, nothing to see here...
|
@@ -80,7 +80,7 @@ def each_arg(*args, &block) | |||
it 'passes if the block yields the specified number of times' do | |||
expect { |b| [1].each(&b) }.to yield_control.once | |||
expect { |b| [1, 2].each(&b) }.to yield_control.twice | |||
expect { |b| [1, 2, 3].each(&b) }.to yield_control.exactly(3).times |
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.
Can you add back an exactly(4).times
so this spec covers the same as before?
Ok well, just a minor tweak to the specs and I think this is good to go |
@fimmtiu are you planning to add |
@myronmarston I think I've made all the requested changes now. |
Thanks, merged. |
Added a
thrice
expectation to complementonce
andtwice
. It's a perfectly good English word -- one of my favourites, in fact -- and I was mildly surprised when it didn't work.Note that I didn't change the output for error messages ("expected foo at least 3 times", etc.), in case anyone's behaviour depends on that.