Sha256: 3eff127d0ed0a6b8f74c8d814e615540874443c4a39fe1b5875a3fde7b28394b

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

require 'spec_helper'

describe Terrapin::CommandLine::PopenRunner do
  if Terrapin::CommandLine::PopenRunner.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'")
      expect($?.exitstatus).to eq(0)
      subject.call("ruby -e 'exit 5'")
      expect($?.exitstatus).to eq(5)
    end
  end
end

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/terrapin-1.0.1/spec/terrapin/command_line/runners/popen_runner_spec.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/terrapin-1.0.1/spec/terrapin/command_line/runners/popen_runner_spec.rb
terrapin-1.0.1 spec/terrapin/command_line/runners/popen_runner_spec.rb
terrapin-1.0.0 spec/terrapin/command_line/runners/popen_runner_spec.rb