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

Allow for multiple captor invocations #144

Merged
merged 2 commits into from Oct 12, 2016
Merged

Allow for multiple captor invocations #144

merged 2 commits into from Oct 12, 2016

Conversation

marchaos
Copy link
Contributor

@marchaos marchaos commented Oct 12, 2016

Allowing multiple invocations to a captor which will store all captured values in .values. .value still remain for backwards compatibility, and will always contain the last invoked capture value.

…ed values in .values. .value still remains for backwards compatibility, and will always contain the last invoked captured value.
@@ -5,5 +5,9 @@ module.exports = ->
capture: create
name: 'captor.capture'
matches: (matcherArgs, actual) ->
if not captor.values
Copy link
Member

Choose a reason for hiding this comment

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

try captor.values ||= [] and see if that works for you here to save a line

@marchaos
Copy link
Contributor Author

marchaos commented Oct 12, 2016

Updated, cheers.

@searls searls merged commit 997047f into testdouble:master Oct 12, 2016
@searls
Copy link
Member

searls commented Oct 12, 2016

Looks good! Thanks!

@searls
Copy link
Member

searls commented Oct 12, 2016

Can you open a PR that documents this in the docs/ section on captors? Once we have that I'll cut a release

@marchaos
Copy link
Contributor Author

Sure! - #145
Let me know if that's the best place.

@marchaos
Copy link
Contributor Author

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.

None yet

2 participants