Sha256: 8a7e28f833a743252fb4b5555b98576d3c7b39a950034f4926baa0c3fad2b33b

Contents?: true

Size: 789 Bytes

Versions: 1

Compression:

Stored size: 789 Bytes

Contents

require_relative '../../test_helper'
describe AgileUtils::Helper do
  context '#shell' do
    it 'returns result for valid command' do
      result = AgileUtils::Helper.shell(%w(ls))
      result.wont_be_nil
    end
    it 'raises error on invalid command' do
      assert_raises(RuntimeError) { AgileUtils::Helper.shell(%w(bad-command)) }
    end
  end

  context '#which' do
    it 'works with valid executable' do
      # TODO: mock or stub the call
      AgileUtils::Helper.which('ruby').wont_be_nil
    end
    it 'works with invalid executable' do
      AgileUtils::Helper.which('bad-or-invalid-executable!').must_be_nil
    end
    it 'works with the binary name only' do
      # TODO: mock or stub the call
      AgileUtils::Helper.which('/bin/bash').must_be_nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
agile_utils-0.0.9 test/lib/agile_utils/test_helper.rb