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

Create matches for strout and strerr output #6

Open
acant opened this issue Jul 6, 2017 · 0 comments
Open

Create matches for strout and strerr output #6

acant opened this issue Jul 6, 2017 · 0 comments

Comments

@acant
Copy link
Contributor

acant commented Jul 6, 2017

Write tabular matchers to wrap the rspec output matchers
https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/output-matcher

The output matchers are used like this:

specify { expect { subject }.to output('hi').to_stdout }
specify { expect { subject }.to output('hi').to_stderr }

And the tabular wrappers could be written like this:

input              :var1, :var2
output_stdout_with :foo,  :bar,  'foobar'
output_stderr_with :dead, :beef, 'error'

I am not sure if the better form is:

  • output_stdout_with, or
  • stdout_with

Or if these should be both be available and aliased.

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

1 participant