aruba icon indicating copy to clipboard operation
aruba copied to clipboard

Make #have_output_size work on a process

Open mvz opened this issue 8 years ago • 6 comments

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.

mvz avatar Sep 03 '17 08:09 mvz

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.

maxmeyer avatar Sep 05 '17 20:09 maxmeyer

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.

stale[bot] avatar Nov 13 '17 06:11 stale[bot]

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.

stale[bot] avatar Jan 12 '18 09:01 stale[bot]

This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.

stale[bot] avatar Jan 19 '18 09:01 stale[bot]

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.

stale[bot] avatar Mar 20 '18 10:03 stale[bot]

This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.

stale[bot] avatar Mar 27 '18 10:03 stale[bot]