spec/packer_config_spec.rb in packer-config-1.3.1 vs spec/packer_config_spec.rb in packer-config-1.4.0
- old
+ new
@@ -20,19 +20,32 @@
describe "#validate" do
it 'returns true for a valid instance' do
expect(packer.builders).to receive(:length).and_return(1)
expect(Packer::Runner).to receive(:run!).and_return('')
+ expect(LoweredExpectations).to receive(:expect).and_return(true)
FakeFS do
expect(packer.validate).to be_truthy
end
end
it 'raises an error for an invalid instance' do
expect(packer.builders).to receive(:length).and_return(0)
+ expect(LoweredExpectations).to receive(:expect).and_return(true)
FakeFS do
expect { packer.validate }.to raise_error
end
+ end
+
+ it 'sets the minimum Packer version' do
+ expect(packer.builders).to receive(:length).and_return(1)
+ expect(Packer::Runner).to receive(:run!).and_return('')
+ expect(LoweredExpectations).to receive(:expect).and_return(true)
+ expect(packer.data['min_packer_version']).to be_falsey
+ FakeFS do
+ expect(packer.validate).to be_truthy
+ end
+ expect(packer.data['min_packer_version']).to eq(Packer::Config::PACKER_VERSION)
end
end
describe '#dump' do
it 'dumps a JSON-formatted configuration' do