spec/artifact_spec.rb in omnibus-2.0.1 vs spec/artifact_spec.rb in omnibus-2.0.2
- old
+ new
@@ -30,10 +30,12 @@
let(:platforms) { [%w(el 5 x86_64), ['sles', '11.2', 'x86_64']] }
let(:artifact) { Omnibus::Artifact.new(path, platforms, version: '11.4.0-1') }
+ let(:flat_metadata) { artifact.flat_metadata }
+
it 'has the path to the package' do
expect(artifact.path).to eq(path)
end
it 'has a list of platforms the package supports' do
@@ -49,11 +51,10 @@
expect(File).to receive(:open).with(path).and_return(content)
expect(artifact.sha256).to eq(sha256)
end
it "generates 'flat' metadata" do
- expect(File).to receive(:open).twice.with(path).and_return(content)
- flat_metadata = artifact.flat_metadata
+ expect(File).to receive(:open).at_least(2).with(path).and_return(content)
expect(flat_metadata['platform']).to eq('el')
expect(flat_metadata['platform_version']).to eq('5')
expect(flat_metadata['arch']).to eq('x86_64')
expect(flat_metadata['version']).to eq('11.4.0-1')
expect(flat_metadata['basename']).to eq('demoproject-11.4.0-1.el5.x86_64.rpm')