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