Sha256: f6515031a39ad90bc9f10616be881ee8d780c4364406b7e96a3bf8dbab918943

Contents?: true

Size: 950 Bytes

Versions: 9

Compression:

Stored size: 950 Bytes

Contents

require 'spec_helper'

describe Minimart::InventoryRequirement::LocalPathRequirement do

  let(:requirement) do
    Minimart::InventoryRequirement::LocalPathRequirement.new('sample_cookbook',
      path: 'spec/fixtures/sample_cookbook')
  end

  describe '::new' do
    it 'should set the name' do
      expect(requirement.name).to eq 'sample_cookbook'
    end

    it 'should set the path' do
      expect(requirement.path).to eq 'spec/fixtures/sample_cookbook'
    end
  end

  describe '#explicit_location?' do
    subject { requirement.explicit_location? }
    it { is_expected.to eq true }
  end

  describe '#matching_source?' do
    let(:metadata) { { 'source_type' => 'local_path' } }
    subject { requirement.matching_source?(metadata) }
    it { is_expected.to eq true }

    context 'when the source type is not local path' do
      before(:each) { metadata['source_type'] = 'git' }
      it { is_expected.to eq false }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.2.4 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.2.3 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.2.0 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.1.6 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.1.3 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.0.2 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-1.0.1 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb
minimart-0.0.1 spec/lib/minimart/inventory_requirement/local_path_requirement_spec.rb