Last active
September 21, 2015 07:38
-
-
Save vinzent/225722bdefeabffc88ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all checks will "fail", but check date output | |
# | |
# fails with: rspec test_spec.rb </dev/null | |
# works with: rspec test_spec.rb | |
require 'serverspec' | |
set :backend, :exec | |
describe 'test' do | |
describe command('date') do | |
its(:stdout) { should match /first date output/ } | |
end | |
describe command('script -qfc "sudo su - -c \'date; sleep 10\'"') do | |
its(:stdout) { should match /fail this to show stdout/ } | |
its(:stderr) { should match /fail this to show stderr/ } | |
end | |
describe command('date') do | |
its(:stdout) { should match /check date output if >=10s after first date output/ } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment