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

Verify the ordering of spies. #439

Merged
merged 7 commits into from Oct 23, 2013
Merged

Verify the ordering of spies. #439

merged 7 commits into from Oct 23, 2013

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Oct 23, 2013

Register invokation order of calls and use it to verify that spies
have been called in order correctly.

Fixes #430.

@@ -86,7 +86,7 @@ def generate_failure_message

def expected_messages_received?
mock_proxy.replay_received_message_on @expectation, &@block
@expectation.expected_messages_received?
@expectation.expected_messages_received? && @expectation.expected_ordering_received?
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a little confusing for this method to be called expected_messages_received? when it does more than that now. Maybe it should be renamed to something like expected_messages_received_in_specified_order? or something?

@JonRowe
Copy link
Member Author

JonRowe commented Oct 23, 2013

Updated the wording too.

@JonRowe
Copy link
Member Author

JonRowe commented Oct 23, 2013

Refactored the loop, refactored the object message tuple to use a value objects. Ready for re-review.

when Module then @module = module_or_name
when String then @name = module_or_name
when Module then @module = module_or_name; @name = nil
when String then @name = module_or_name; @module = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been refactored in master and I suspect this won't merge now.

@myronmarston
Copy link
Member

LGTM. Merge away.

JonRowe added a commit that referenced this pull request Oct 23, 2013
Verify the ordering of spies.
@JonRowe JonRowe merged commit 87a7e24 into master Oct 23, 2013
@JonRowe JonRowe deleted the ordering_spies branch October 23, 2013 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ordered message expectations on spies
2 participants