1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
require 'spec_helper'
describe Fission::Action::ShellExecutor do
describe 'execute' do
before do
@cmd = 'ls /var/log'
@executor = Fission::Action::ShellExecutor.new @cmd
end
it 'should execute the shell command' do
@executor.should_receive(:`).with(@cmd)
@executor.execute
end
it 'should return a hash of the output and Process::Status object' do
result = @executor.execute
result['output'].should be_a String
result['output'].empty?.should be false
result['process_status'].should be_a Process::Status
end
end
end
|