Sha256: 2affcac7f3c998622d7272c645fb4fb553ebc51f5ea862ba9506cfe85cda2ae7

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require File.expand_path('../spec_helper', __FILE__)

describe ManifestHandler do

  let(:settings) do
    s = Settings.new
    s.manifest_path = File.expand_path('spec/data/')
    s.offline = true
    s
  end
  
  let(:mh) do
    mh = ManifestHandler.new settings
    mh.read_remote
    mh
  end
  
  it "reads manifests" do
    mh.manifests.count.should == 2
    mh.libraries.count.should == 2
    mh.read_remote
    mh.manifests.count.should == 2
    mh.libraries.count.should == 2
  end

  it "provides access to manifests" do
    mh.manifest("awesomelib").class.should == Hash
    expect { mh.manifest("nonexisting") }.to raise_error
  end
  
  context "#libraries" do

    it "returns all libraries" do
      expect( mh.libraries.count ).to eq 2
    end
    
    it "returns stable libraries" do
      libraries = mh.libraries :stable
      expect( libraries.count ).to eq 1
      expect( libraries.first.manifests.last["name"] ).to eq "awesomelib"
      expect( libraries.first.manifests.last["version"] ).to eq "0.2.0"
    end
    
    it "returns development versions" do
      libraries = mh.libraries :edge
      expect( libraries.count ).to eq 1
      expect( libraries.first.manifests.last["name"] ).to eq "bleedingedge"
      expect( libraries.first.manifests.last["version"] ).to eq "edge"
    end

  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inqlude-0.0.8 spec/manifest_handler_spec.rb