Sha256: 4abf1055be75b59ee0ee024ec3a8380e84c2eaed1c57bc443913253cde9d533b

Contents?: true

Size: 693 Bytes

Versions: 29

Compression:

Stored size: 693 Bytes

Contents

#!/usr/bin/env ruby

path = './fixtures/timeout'
buffer = []
command = Shipit::Command.new({path => {'timeout' => 2}}, env: {}, chdir: __dir__)
begin
  command.stream! do |chunk|
    buffer << chunk
  end
rescue Shipit::Command::TimedOut
  # expected
end

expected_output = [
  "Sleeping for 10 seconds\r\n",
  "\e[1;31mNo output received in the last 2 seconds.\e[0m\n",
  "\e[1;31mSending SIGINT to PID #{command.pid}\n\e[0m",
  "Recieved SIGINT, aborting.\r\n",
]

unless buffer.join == expected_output.join
  puts "Expected: -------"
  puts expected_output.map(&:inspect).join("\n")
  puts "Got: ------------"
  puts buffer.map(&:inspect).join("\n")
  puts "-----------------"
  exit 1
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 test/test_command_integration.rb
shipit-engine-0.30.0 test/test_command_integration.rb
shipit-engine-0.29.0 test/test_command_integration.rb
shipit-engine-0.28.1 test/test_command_integration.rb
shipit-engine-0.28.0 test/test_command_integration.rb
shipit-engine-0.27.1 test/test_command_integration.rb
shipit-engine-0.27.0 test/test_command_integration.rb
shipit-engine-0.26.0 test/test_command_integration.rb
shipit-engine-0.25.1 test/test_command_integration.rb
shipit-engine-0.25.0 test/test_command_integration.rb
shipit-engine-0.24.0 test/test_command_integration.rb
shipit-engine-0.23.1 test/test_command_integration.rb
shipit-engine-0.23.0 test/test_command_integration.rb
shipit-engine-0.22.0 test/test_command_integration.rb
shipit-engine-0.21.0 test/test_command_integration.rb
shipit-engine-0.20.1 test/test_command_integration.rb
shipit-engine-0.20.0 test/test_command_integration.rb
shipit-engine-0.19.0 test/test_command_integration.rb
shipit-engine-0.18.1 test/test_command_integration.rb
shipit-engine-0.18.0 test/test_command_integration.rb