2015-09-25 19:16:07 +02:00
|
|
|
# encoding: utf-8
|
2015-10-06 18:55:44 +02:00
|
|
|
# author: Dominik Richter
|
|
|
|
# author: Christoph Hartmann
|
2015-10-05 23:46:33 +02:00
|
|
|
|
2015-09-03 13:22:15 +02:00
|
|
|
describe command('echo hello') do
|
2016-05-03 23:14:33 +01:00
|
|
|
its('stdout') { should eq "hello\n" }
|
|
|
|
its('stderr') { should eq '' }
|
|
|
|
its('exit_status') { should eq 0 }
|
2015-09-03 13:22:15 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe command('>&2 echo error') do
|
2016-05-03 23:14:33 +01:00
|
|
|
its('stdout') { should eq '' }
|
|
|
|
its('stderr') { should eq "error\n" }
|
|
|
|
its('exit_status') { should eq 0 }
|
2015-09-03 13:22:15 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe command('exit 123') do
|
2016-05-03 23:14:33 +01:00
|
|
|
its('stdout') { should eq '' }
|
|
|
|
its('stderr') { should eq '' }
|
|
|
|
its('exit_status') { should eq 123 }
|
2015-09-03 13:22:15 +02:00
|
|
|
end
|
|
|
|
|
2015-09-18 12:44:29 +02:00
|
|
|
describe command('/bin/sh').exist? do
|
2015-09-03 13:22:15 +02:00
|
|
|
it { should eq true }
|
|
|
|
end
|
|
|
|
|
2015-09-18 12:44:29 +02:00
|
|
|
describe command('sh').exist? do
|
2015-09-03 13:22:15 +02:00
|
|
|
it { should eq true }
|
|
|
|
end
|
|
|
|
|
2015-09-18 12:44:29 +02:00
|
|
|
describe command('this is not existing').exist? do
|
2015-09-03 13:22:15 +02:00
|
|
|
it { should eq false }
|
|
|
|
end
|