Sha256: c334d1065b5637a8b6c7f10d0855dd03f50f2ab8dba4b1decb95cda6e06b7b0e

Contents?: true

Size: 610 Bytes

Versions: 6

Compression:

Stored size: 610 Bytes

Contents

require 'spec_helper'

describe Cocaine::CommandLine::ProcessRunner do
  if Process.respond_to?(:spawn)
    it_behaves_like "a command that does not block"

    it 'runs the command given' do
      subject.call("echo hello").should == "hello\n"
    end

    it 'modifies the environment and runs the command given' do
      subject.call("echo $yes", {"yes" => "no"}).should == "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

6 entries across 6 versions & 1 rubygems

Version Path
cocaine-0.5.1 spec/cocaine/command_line/runners/process_runner_spec.rb
cocaine-0.5.0 spec/cocaine/command_line/runners/process_runner_spec.rb
cocaine-0.4.2 spec/cocaine/command_line/runners/process_runner_spec.rb
cocaine-0.4.1 spec/cocaine/command_line/runners/process_runner_spec.rb
cocaine-0.4.0 spec/cocaine/command_line/runners/process_runner_spec.rb
cocaine-0.3.2 spec/cocaine/command_line/runners/process_runner_spec.rb