Tests to verify that the instance method exists for configs
This commit is contained in:
parent
19d00a8802
commit
6cfddb6c38
|
@ -133,7 +133,6 @@ class ConfigTest < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
@configures_list = []
|
@configures_list = []
|
||||||
Vagrant::Config::Top.stubs(:configures_list).returns(@configures_list)
|
Vagrant::Config::Top.stubs(:configures_list).returns(@configures_list)
|
||||||
Vagrant::Config::Top.stubs(:attr_reader)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "adding configure keys" do
|
context "adding configure keys" do
|
||||||
|
@ -148,7 +147,11 @@ class ConfigTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "initializing" do
|
context "configuration keys on instance" do
|
||||||
|
setup do
|
||||||
|
@configures_list.clear
|
||||||
|
end
|
||||||
|
|
||||||
should "initialize each configurer and set it to its key" do
|
should "initialize each configurer and set it to its key" do
|
||||||
5.times do |i|
|
5.times do |i|
|
||||||
key = "key#{i}"
|
key = "key#{i}"
|
||||||
|
@ -160,6 +163,17 @@ class ConfigTest < Test::Unit::TestCase
|
||||||
|
|
||||||
Vagrant::Config::Top.new
|
Vagrant::Config::Top.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "allow reading via methods" do
|
||||||
|
key = "my_foo_bar_key"
|
||||||
|
klass = mock("klass")
|
||||||
|
instance = mock("instance")
|
||||||
|
klass.expects(:new).returns(instance)
|
||||||
|
Vagrant::Config::Top.configures(key, klass)
|
||||||
|
|
||||||
|
config = Vagrant::Config::Top.new
|
||||||
|
assert_equal instance, config.send(key)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "loaded status" do
|
context "loaded status" do
|
||||||
|
|
Loading…
Reference in New Issue