From 2492f479d5f79190124b41b5636cf824ccc53c2b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 7 Jul 2011 23:58:42 -0700 Subject: [PATCH] Tests passing from recent action changes --- test/vagrant/action/vm/customize_test.rb | 1 + test/vagrant/action/vm/forward_ports_test.rb | 10 +++++----- test/vagrant/action/vm/match_mac_address_test.rb | 2 +- test/vagrant/action/vm/share_folders_test.rb | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/vagrant/action/vm/customize_test.rb b/test/vagrant/action/vm/customize_test.rb index 84ecaeaa0..cdbf0bd6b 100644 --- a/test/vagrant/action/vm/customize_test.rb +++ b/test/vagrant/action/vm/customize_test.rb @@ -24,6 +24,7 @@ class CustomizeVMActionTest < Test::Unit::TestCase @env.env.config.vm.customize { |vm| } @env.env.config.vm.expects(:run_procs!).with(@internal_vm) @internal_vm.expects(:save).once + @env["vm"].expects(:reload!).once @app.expects(:call).with(@env).once @instance.call(@env) end diff --git a/test/vagrant/action/vm/forward_ports_test.rb b/test/vagrant/action/vm/forward_ports_test.rb index 6e1d32e95..bcf1ad62c 100644 --- a/test/vagrant/action/vm/forward_ports_test.rb +++ b/test/vagrant/action/vm/forward_ports_test.rb @@ -143,8 +143,8 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase network_adapter.expects(:attachment_type).returns(:nat) @instance.expects(:forward_port).once - @internal_vm.expects(:save).once - @vm.expects(:reload!).once + + @env["config"].vm.stubs(:customize).yields(@internal_vm) @instance.forward_ports end @@ -154,8 +154,8 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase @internal_vm.expects(:network_adapters).returns([network_adapter]) network_adapter.expects(:attachment_type).returns(:host_only) - @internal_vm.expects(:save).once - @vm.expects(:reload!).once + + @env["config"].vm.stubs(:customize).yields(@internal_vm) @instance.forward_ports end end @@ -188,7 +188,7 @@ class ForwardPortsVMActionTest < Test::Unit::TestCase adapters[opts[:adapter]] = adapter @internal_vm.stubs(:network_adapters).returns(adapters) - @instance.forward_port(name, opts) + @instance.forward_port(@internal_vm, name, opts) end end end diff --git a/test/vagrant/action/vm/match_mac_address_test.rb b/test/vagrant/action/vm/match_mac_address_test.rb index 0795502b8..b091b55f0 100644 --- a/test/vagrant/action/vm/match_mac_address_test.rb +++ b/test/vagrant/action/vm/match_mac_address_test.rb @@ -20,9 +20,9 @@ class MatchMACAddressVMActionTest < Test::Unit::TestCase update_seq = sequence("update_seq") @internal_vm.expects(:network_adapters).returns([nic]).once.in_sequence(update_seq) - @internal_vm.expects(:save).once.in_sequence(update_seq) @app.expects(:call).with(@env).once.in_sequence(update_seq) + @env["config"].vm.expects(:customize).yields(@internal_vm) @instance.call(@env) end diff --git a/test/vagrant/action/vm/share_folders_test.rb b/test/vagrant/action/vm/share_folders_test.rb index 58ac1ccc3..e29efbdbb 100644 --- a/test/vagrant/action/vm/share_folders_test.rb +++ b/test/vagrant/action/vm/share_folders_test.rb @@ -105,8 +105,8 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase end @internal_vm.stubs(:shared_folders).returns(shared_folders) - @internal_vm.expects(:save).once + @env["config"].vm.expects(:customize).yields(@internal_vm) @instance.create_metadata end end