Sha256: a54cf4bab65ad6feae11da9c4e348bbaec7960297312060b3d2212cce3bf0ae5

Contents?: true

Size: 516 Bytes

Versions: 6

Compression:

Stored size: 516 Bytes

Contents

require 'test_helper'
require_relative '../../lib/nesta/system_command'

describe 'Nesta::SystemCommand' do
  describe '#run' do
    it 'catches errors when running external processes' do
      command = Nesta::SystemCommand.new
      command.run('ls / >/dev/null')
      begin
        stderr, $stderr = $stderr, StringIO.new
        assert_raises(SystemExit) do
          command.run('ls no-such-file 2>/dev/null')
        end
      ensure
        $stderr.close
        $stderr = stderr
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nesta-0.18.0 test/unit/system_command_test.rb
nesta-0.17.0 test/unit/system_command_test.rb
nesta-0.16.0 test/unit/system_command_test.rb
nesta-0.15.0 test/unit/system_command_test.rb
nesta-0.14.0 test/unit/system_command_test.rb
nesta-0.13.0 test/unit/system_command_test.rb