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

Command type returns stdout, so you can use any matchers you like to the stdout #280

merged 3 commits into from Oct 16, 2013


Copy link

@mizzy mizzy commented Oct 16, 2013

This is a sample implementation to meet the demand of @rickhull in #276.

You can write spec like this.

describe command('ls -al /') do
  its(:stdout) { should match /bin/ }

You can use any matchers that rspec has.And the command runs only once because its stdout is cached.

Copy link

@rickhull rickhull commented Oct 16, 2013


Copy link

@smontanari smontanari commented Oct 16, 2013

Looks good to me. Only thing I would probably have to change a little the code in the command type to accomodate the case of when we use winrm instead of ssh, to cater for windows commands. I've got already some work in progress in my windows-support branch to allow running commands from windows, but I'll wait until this change is all nicely merged into master before submitting a pull request

mizzy added a commit that referenced this issue Oct 16, 2013
Command type returns stdout, so you can use any matchers you like to the stdout
@mizzy mizzy merged commit cb5452e into master Oct 16, 2013
1 check passed
@mizzy mizzy deleted the command-stdout branch Oct 16, 2013
Copy link
Owner Author

@mizzy mizzy commented Oct 16, 2013

Thanks for your cheking, @rickhull and @smontanari .

I've just merged to master.I'm looking forward your pull request, @smontanari .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
3 participants