Add test for validating box metadata.json
This commit is contained in:
parent
ccc232914d
commit
115bec2b05
@ -44,6 +44,19 @@ describe Vagrant::Box, :skip_windows do
|
||||
f.write(JSON.generate(data))
|
||||
end
|
||||
|
||||
# Verify the metadata
|
||||
expect { subject.metadata }.
|
||||
to raise_error(Vagrant::Errors::BoxMetadataMissingRequiredFields)
|
||||
end
|
||||
|
||||
it "provides the metadata associated with a box" do
|
||||
data = { "provider" => "bar" }
|
||||
|
||||
# Write the metadata
|
||||
directory.join("metadata.json").open("w") do |f|
|
||||
f.write(JSON.generate(data))
|
||||
end
|
||||
|
||||
# Verify the metadata
|
||||
expect(subject.metadata).to eq(data)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user