Update tests to create V2 plugins
This commit is contained in:
parent
1d2beff649
commit
02e499da47
|
@ -18,7 +18,7 @@ shared_context "unit" do
|
||||||
# Unregister each of the plugins we have may have temporarily
|
# Unregister each of the plugins we have may have temporarily
|
||||||
# registered for the duration of this test.
|
# registered for the duration of this test.
|
||||||
@_plugins.each do |plugin|
|
@_plugins.each do |plugin|
|
||||||
Vagrant.plugin("1").manager.unregister(plugin)
|
Vagrant.plugin("2").manager.unregister(plugin)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ shared_context "unit" do
|
||||||
# @yield [plugin] Yields the plugin class for you to call the public
|
# @yield [plugin] Yields the plugin class for you to call the public
|
||||||
# API that you need to.
|
# API that you need to.
|
||||||
def register_plugin
|
def register_plugin
|
||||||
plugin = Class.new(Vagrant.plugin("1"))
|
plugin = Class.new(Vagrant.plugin("2"))
|
||||||
plugin.name("Test Plugin #{plugin.inspect}")
|
plugin.name("Test Plugin #{plugin.inspect}")
|
||||||
yield plugin if block_given?
|
yield plugin if block_given?
|
||||||
@_plugins << plugin
|
@_plugins << plugin
|
||||||
|
|
|
@ -214,7 +214,7 @@ describe Vagrant::Machine do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should return the configured guest" do
|
it "should return the configured guest" do
|
||||||
test_guest = Class.new(Vagrant.plugin("1", :guest))
|
test_guest = Class.new(Vagrant.plugin("2", :guest))
|
||||||
|
|
||||||
register_plugin do |p|
|
register_plugin do |p|
|
||||||
p.guest(:test) { test_guest }
|
p.guest(:test) { test_guest }
|
||||||
|
@ -235,13 +235,13 @@ describe Vagrant::Machine do
|
||||||
|
|
||||||
it "should distro dispatch to the most specific guest" do
|
it "should distro dispatch to the most specific guest" do
|
||||||
# Create the classes and dispatch the parent into the child
|
# Create the classes and dispatch the parent into the child
|
||||||
guest_parent = Class.new(Vagrant.plugin("1", :guest)) do
|
guest_parent = Class.new(Vagrant.plugin("2", :guest)) do
|
||||||
def distro_dispatch
|
def distro_dispatch
|
||||||
:child
|
:child
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
guest_child = Class.new(Vagrant.plugin("1", :guest))
|
guest_child = Class.new(Vagrant.plugin("2", :guest))
|
||||||
|
|
||||||
# Register the classes
|
# Register the classes
|
||||||
register_plugin do |p|
|
register_plugin do |p|
|
||||||
|
@ -256,7 +256,7 @@ describe Vagrant::Machine do
|
||||||
|
|
||||||
it "should protect against loops in the distro dispatch" do
|
it "should protect against loops in the distro dispatch" do
|
||||||
# Create the classes and dispatch the parent into the child
|
# Create the classes and dispatch the parent into the child
|
||||||
guest_parent = Class.new(Vagrant.plugin("1", :guest)) do
|
guest_parent = Class.new(Vagrant.plugin("2", :guest)) do
|
||||||
def distro_dispatch
|
def distro_dispatch
|
||||||
:parent
|
:parent
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue