Sha256: c8d7e2be6cc679705219f580ec9a1695fcd303914d07e8d81554d09eec229508

Contents?: true

Size: 821 Bytes

Versions: 4

Compression:

Stored size: 821 Bytes

Contents

require 'epitools'

describe "autoreq" do

  it "should have MimeMagic and Units installed" do
    gems = Gem.source_index.to_a.map{|name, spec| spec.name}.uniq
    gems.include?("mimemagic").should == true
    gems.include?("units").should == true
  end

  it "autoreqs a gem" do
    defined?(MimeMagic).should == nil

    autoreq :MimeMagic, 'mimemagic'
    lambda { MimeMagic }.should_not raise_error
  end
    
  it "autoreqs a regular ruby file" do
    defined?(Net).should == nil
    
    module Net
      autoreq :HTTP, 'net/http'
    end
    lambda { Net::HTTP }.should_not raise_error
  end
    
  it "autoreqs a gem with a block" do
    defined?(Units).should == nil
    
    autoreq :Units do
      gem 'units', '~> 1.0'
      require 'units'
    end
    lambda { Units }.should_not raise_error
  end
    
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
epitools-0.4.47 spec/autoreq_spec.rb
epitools-0.4.46 spec/autoreq_spec.rb
epitools-0.4.45 spec/autoreq_spec.rb
epitools-0.4.44 spec/autoreq_spec.rb