Add unit tests for Registry#keys.

This commit is contained in:
John Bellone 2013-12-16 18:16:19 -05:00
parent 4194da19c6
commit 8909018af6
1 changed files with 7 additions and 0 deletions

View File

@ -40,6 +40,13 @@ describe Vagrant::Registry do
instance["foo"].should eql(object)
end
it "should be able to get keys with #keys" do
instance.register("foo") { "bar" }
instance.register("baz") { "qux" }
instance.keys.sort.should == [ 'baz', 'foo' ]
end
it "should cache the result of the item so they can be modified" do
# Make the proc generate a NEW array each time