Sha256: 1b6a01f892353fc9743c00faa336ee4169255c88cbcb99a23f0eb0947dda1413

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe Berkshelf::PathLocation do
  let(:complacent_constraint) { double('comp-vconstraint', satisfies?: true) }
  let(:path) { fixtures_path.join('cookbooks', 'example_cookbook').to_s }

  describe '.new' do
    it 'assigns the value of :path to @path' do
      location = Berkshelf::PathLocation.new('nginx', complacent_constraint, path: path)
      expect(location.path).to eq(path)
    end
  end



  subject { Berkshelf::PathLocation.new('nginx', complacent_constraint, path: path) }

  describe '#to_s' do
    context 'for a remote path' do
      subject { Berkshelf::PathLocation.new('nginx', complacent_constraint, path: path) }

      it 'includes the path information' do
        expect(subject.to_s).to match(/path\:.+example_cookbook/)
      end
    end

    context 'for a store path' do
      subject { Berkshelf::PathLocation.new('nginx', complacent_constraint, path: File.join(Berkshelf.berkshelf_path, 'cookbooks/example_cookbook')) }

      it 'does not include the path information' do
        expect(subject.to_s).to_not match(/path\:.+/)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
berkshelf-2.0.18 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.17 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.16 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.15 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.14 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.13 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.12 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.11 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.10 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.9 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.8 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.7 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.6 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.5 spec/unit/berkshelf/locations/path_location_spec.rb
berkshelf-2.0.4 spec/unit/berkshelf/locations/path_location_spec.rb