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

'have_output_on_stdout' doesn't work with 'all_commands' #576

Closed
peagha opened this issue Nov 2, 2018 · 3 comments
Closed

'have_output_on_stdout' doesn't work with 'all_commands' #576

peagha opened this issue Nov 2, 2018 · 3 comments
Assignees
Labels

Comments

@peagha
Copy link

peagha commented Nov 2, 2018

Summary

I'm fixing the deprecation warnings in my app, and message suggests me to use expect(all_commands).to have_output_on_stdout /output/, but the matcher doesn't seem to work with all_commands .

Expected Behavior

Given a command:

run('echo output')

and the expectation:

expect(all_commands).to have_output_on_stdout /output/

The test should pass.

Current Behavior

The test fails with the message:

expected [#<Aruba::Command(#<Aruba::Processes::SpawnProcess:70349724675560 commandline="echo output": output="output
">)>] to have output on stdout: /output/
Diff:
@@ -1,2 +1,3 @@
-/output/
+[#<Aruba::Command(#<Aruba::Processes::SpawnProcess:70349724675560 commandline="echo output": output="output
+">)>]
 (RSpec::Expectations::ExpectationNotMetError)

Possible Solution

The have_output_on_stdout matcher expects an object that responds to stdout:

  • update all_commands to respond to stdout
  • update have_output_on_stdout to handle Arrays
  • update the deprecation warning to use last_command_started

Maybe the matcher can also be updated to provide a more meaningful message when it receives an object it can't handle.

Steps to Reproduce (for bugs)

(I didn't provide a list of steps because the bug is fairly easy to reproduce. If you need more info let me know)

Context & Motivation

I wasn't able to follow the warnings and update my app successfully.

Your Environment

  • Version used: Aruba 0.14.6
  • Operating System and version: macOs El Capitan
  • Link to your project: N/D
@peagha peagha changed the title have_output_on_stdout doesn't work with all_commands 'have_output_on_stdout' doesn't work with 'all_commands' Nov 2, 2018
@stale
Copy link

stale bot commented Jan 1, 2019

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 stale bot added the stale These issues were closed by stalebot and need to be reviewed to see if they're still relevant. label Jan 1, 2019
@peagha
Copy link
Author

peagha commented Jan 2, 2019

/unstale

@stale stale bot removed the stale These issues were closed by stalebot and need to be reviewed to see if they're still relevant. label Jan 2, 2019
@mvz mvz added the bug label Mar 3, 2019
@mvz mvz self-assigned this Mar 13, 2019
@mvz
Copy link
Contributor

mvz commented Mar 13, 2019

Fixed in #601 by changing the deprecation message.

@mvz mvz closed this as completed Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants