Sha256: 117f8a047df0fc687648b71fdfa691c1d66a615e950b36209f60f9b3ebab7b69

Contents?: true

Size: 740 Bytes

Versions: 5

Compression:

Stored size: 740 Bytes

Contents

require 'spec_helper'

describe Cocaine::CommandLine::BackticksRunner do
  if Cocaine::CommandLine::BackticksRunner.supported?
    it_behaves_like 'a command that does not block'

    it 'runs the command given and captures the output in an Output' do
      output = subject.call("echo hello")
      expect(output).to have_output "hello\n"
    end

    it 'modifies the environment and runs the command given' do
      output = subject.call("echo $yes", {"yes" => "no"})
      expect(output).to have_output "no\n"
    end

    it 'sets the exitstatus when a command completes' do
      subject.call("ruby -e 'exit 0'")
      $?.exitstatus.should == 0
      subject.call("ruby -e 'exit 5'")
      $?.exitstatus.should == 5
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
cocaine-0.6.0 spec/cocaine/command_line/runners/backticks_runner_spec.rb
cocaine-0.6.0.alpha spec/cocaine/command_line/runners/backticks_runner_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/cocaine-0.5.8/spec/cocaine/command_line/runners/backticks_runner_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/cocaine-0.5.8/spec/cocaine/command_line/runners/backticks_runner_spec.rb
cocaine-0.5.8 spec/cocaine/command_line/runners/backticks_runner_spec.rb