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 to_output to accept multiple arguments #943

Closed
malclocke opened this issue Sep 20, 2016 · 1 comment
Closed

Allow to_output to accept multiple arguments #943

malclocke opened this issue Sep 20, 2016 · 1 comment

Comments

@malclocke
Copy link

Hi folks,

Would you be willing to accept a PR that allows the following?

expect { some_method }.to_output(/This stuff/, /and this stuff/).to_stdout

As to_output currently only accepts one argument, the only solution I can see is to do the following:

expect { some_method }.to_output(/This stuff/).to_stdout
expect { some_method }.to_output(/and this stuff/).to_stdout

and this is less than ideal when some_method is expensive.

@myronmarston
Copy link
Member

This is already supported by passing a compound matcher:

expect { some_method }.to_output(
  a_string_matching(/This stuff/).and matching(/and this stuff/
).to_stdout

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

No branches or pull requests

2 participants