Sha256: 5c1b96446f86b005b4c6c6d200779e7ea27b727ca8e09c53423669e5aebb454a

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

module Berkshelf
  describe CookbookSource::PathLocation do
    let(:path) { fixtures_path.join("cookbooks", "example_cookbook").to_s }
    subject { CookbookSource::PathLocation.new("nginx", :path => path) }

    describe "#download" do
      it "returns the path to the cookbook" do
        subject.download(tmp_path).should eql(path)
      end

      context "given a path that does not exist" do
        subject { CookbookSource::PathLocation.new("doesnot_exist", :path => tmp_path.join("doesntexist_noway")) }

        it "raises a CookbookNotFound error" do
          lambda {
            subject.download(tmp_path)
          }.should raise_error(CookbookNotFound)
        end
      end

      context "given a path that does not contain a cookbook" do
        subject { CookbookSource::PathLocation.new("doesnot_exist", :path => fixtures_path) }

        it "raises a CookbookNotFound error" do
          lambda {
            subject.download(tmp_path)
          }.should raise_error(CookbookNotFound)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
berkshelf-0.3.3 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.3.2 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.3.1 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.3.0 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.2.0 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.1.5 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.1.4 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.1.3 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.1.2 spec/unit/berkshelf/cookbook_source/path_location_spec.rb
berkshelf-0.1.1 spec/unit/berkshelf/cookbook_source/path_location_spec.rb