spec/unit/berkshelf/locations/path_spec.rb in berkshelf-3.0.0.rc1 vs spec/unit/berkshelf/locations/path_spec.rb in berkshelf-3.0.0
- old
+ new
@@ -9,12 +9,12 @@
name: 'nginx',
version_constraint: constraint,
berksfile: berksfile,
)
end
- let(:path) { fixtures_path.join('cookbooks', 'example_cookbook').to_s }
- let(:relative_path) { '../../../fixtures/cookbooks/example_cookbook' }
+ let(:path) { fixtures_path.join('cookbooks', 'example_cookbook') }
+ let(:relative_path) { Pathname.new('../../../fixtures/cookbooks/example_cookbook') }
subject { described_class.new(dependency, path: path) }
describe '#installed?' do
it 'returns false' do
@@ -42,11 +42,11 @@
end
end
describe '#expanded_path' do
it 'returns the expanded path, relative to the Berksfile' do
- absolute_path = File.expand_path(relative_path, File.dirname(berksfile.filepath))
+ absolute_path = Pathname.new(File.expand_path(relative_path, File.dirname(berksfile.filepath)))
expect(subject.expanded_path).to eq(absolute_path)
end
end
describe '#==' do
@@ -90,10 +90,10 @@
EOH
end
end
describe '#to_s' do
- it 'uses the expanded path' do
+ it 'uses the relative path' do
expect(subject.to_s).to eq("source at #{relative_path}")
end
end
describe '#inspect' do