Tests passing for V1 config changes
This commit is contained in:
parent
d15acde8c0
commit
2081fe5650
|
@ -45,7 +45,6 @@ describe Vagrant::Config::V1::Loader do
|
||||||
# Test that we have all keys
|
# Test that we have all keys
|
||||||
result = described_class.init
|
result = described_class.init
|
||||||
result.bar.should be_kind_of(OpenStruct)
|
result.bar.should be_kind_of(OpenStruct)
|
||||||
expect { result.foo }.to raise_error(NoMethodError)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,6 @@ describe Vagrant::Config::V1::Root do
|
||||||
instance.foo.should eql(foo)
|
instance.foo.should eql(foo)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should raise a proper NoMethodError if a config key doesn't exist" do
|
|
||||||
instance = described_class.new({})
|
|
||||||
expect { instance.foo }.to raise_error(NoMethodError)
|
|
||||||
end
|
|
||||||
|
|
||||||
it "can be created with initial state" do
|
it "can be created with initial state" do
|
||||||
instance = described_class.new({}, { :foo => "bar" })
|
instance = described_class.new({}, { :foo => "bar" })
|
||||||
instance.foo.should == "bar"
|
instance.foo.should == "bar"
|
||||||
|
@ -28,7 +23,18 @@ describe Vagrant::Config::V1::Root do
|
||||||
instance = described_class.new(map)
|
instance = described_class.new(map)
|
||||||
instance.__internal_state.should == {
|
instance.__internal_state.should == {
|
||||||
"config_map" => map,
|
"config_map" => map,
|
||||||
"keys" => {}
|
"keys" => {},
|
||||||
|
"missing_key_calls" => Set.new
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should record missing key calls" do
|
||||||
|
instance = described_class.new({})
|
||||||
|
instance.foo.bar = false
|
||||||
|
|
||||||
|
keys = instance.__internal_state["missing_key_calls"]
|
||||||
|
keys.should be_kind_of(Set)
|
||||||
|
keys.length.should == 1
|
||||||
|
keys.include?("foo").should be
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue