Make #have_output_size work on a process
Summary
The #have_output_size matcher is implemented to match on a string, leading to redundant-look assertions like:
expect(last_command_started.output).to have_output_size size.to_i
Expected Behavior
I would expect the call to #output in the example above not to be needed, so one could write:
expect(last_command_started).to have_output_size size.to_i
Possible Solution
Either allow for both options with a responds_to? check, or require an object that has #output outright. The latter one would have my heartfelt preference.
Context & Motivation
The 1.0.0 release is a great time to make this change before the confusing behavior is part of the public API. I came across this issue while updating the code to no longer use #all_output.
Yeah. Makes sense to me. Go ahead. But we should add an entry for this to the CHANGELOG. We could add a deprecation notice to 0.x.x to output a warning if one uses a string with this matcher.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.