spec/unit/berkshelf/dependency_spec.rb in berkshelf-3.0.0.beta2 vs spec/unit/berkshelf/dependency_spec.rb in berkshelf-3.0.0.beta3

- old
+ new

@@ -213,11 +213,11 @@ expect(hash).to_not have_key(key) end end it 'includes the locked version' do - subject.stub(cached_cookbook: double('cached', version: '1.2.3')) + subject.stub(locked_version: double('cached', to_s: '1.2.3')) expect(hash).to have_key(:locked_version) expect(hash[:locked_version]).to eq('1.2.3') end @@ -270,9 +270,24 @@ it { should be_true } end context "when the location is a PathLocation" do let(:options) { { path: fixtures_path.join('cookbooks', 'example_cookbook') } } + it { should be_false } + end + end + + describe "#path_location?" do + let(:options) { Hash.new } + subject { described_class.new(berksfile, cookbook_name, options).path_location? } + + context "when the location is a PathLocation" do + let(:options) { { path: fixtures_path.join("cookbooks", "example_cookbook") } } + it { should be_true } + end + + context "when the location is not a PathLocation" do + let(:options) { { github: "RiotGames/berkshelf" } } it { should be_false } end end end