File: execute_shell_command_spec.rb

package info (click to toggle)
ruby-fission 0.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 624 kB
  • sloc: ruby: 4,664; makefile: 10
file content (25 lines) | stat: -rw-r--r-- 597 bytes parent folder | download | duplicates (3)
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