Sha256: 7fbdd05ca94a916a0f35d30bc9414b76fb6c91b4f013a409c1d7cf9da952c631

Contents?: true

Size: 764 Bytes

Versions: 4

Compression:

Stored size: 764 Bytes

Contents

require 'repertoire/compat'

require 'spec_helper'

describe Compat do
  it "should have a list of directories that contain programs" do
    Compat.paths.any? { |dir|
      File.directory?(dir)
    }.should == true
  end

  it "should be able to find programs" do
    File.executable?(Compat.find_program('dir')).should == true
  end

  it "should be able to run programs" do
    Compat.sh('dir').should_not == false
  end

  it "should raise ProgramNotFound when running missing programs" do
    lambda {
      Compat.sh('obviously_not_there')
    }.should raise_error(ProgramNotFound)
  end

  it "should raise CommandFailed when the program fails" do
    lambda {
      Compat.sh('dir','obviously_missing_dir')
    }.should raise_error(CommandFailed)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
repertoire-0.2.3 spec/compat_spec.rb
repertoire-0.2.0 spec/compat_spec.rb
repertoire-0.2.2 spec/compat_spec.rb
repertoire-0.2.1 spec/compat_spec.rb