Skip to content
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

Run after filters before verifying there are expectations #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Run after filters before verifying there are expectations #99

wants to merge 1 commit into from

Conversation

mattgreen
Copy link

Currently, spec gems such as WebStub and motion-stump have difficulty expressing mock expectations, because these sorts of mocks usually would end up in an after block registered by the library. However, Bacon expects after blocks to be used for clean-up only. Because after blocks are not allowed to contain expectations, users have to clutter their code with bogus expectations like 1.should == 1 in order to get the tests to pass.

This pull request simply runs the after filters before verifying at least one expectation is set, allowing after blocks to contain expectations.

@andyw8
Copy link

andyw8 commented Jun 25, 2013

+1

@mattgreen
Copy link
Author

@alloy, do you have any thoughts on this feature? I'm not tied to the particular implementation, just that some sort of expectation functionality is possible.

@LandonSchropp
Copy link

+1

My current workaround is to add true.should == true to the bottom of my spec, which is really ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants