Removed `mock_vm` test helper, which is unnecessary

This commit is contained in:
Mitchell Hashimoto 2010-10-03 18:45:09 -07:00
parent e5be4cc2b0
commit 3fe785ab72
5 changed files with 4 additions and 18 deletions

View File

@ -23,15 +23,6 @@ I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
class Test::Unit::TestCase
include Vagrant::TestHelpers
# Sets up the mocks for a VM
def mock_vm(env=nil)
env ||= vagrant_env
vm = Vagrant::VM.new
vm.stubs(:env).returns(env)
vm.stubs(:ssh).returns(Vagrant::SSH.new(vm.env))
vm
end
# Sets up the mocks and stubs for a downloader
def mock_downloader(downloader_klass)
tempfile = mock("tempfile")

View File

@ -2,8 +2,7 @@ require "test_helper"
class ChefServerProvisionerTest < Test::Unit::TestCase
setup do
@action_env = Vagrant::Action::Environment.new(vagrant_env)
@action_env.env.vm = mock_vm
@action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
@action = Vagrant::Provisioners::ChefServer.new(@action_env)
@env = @action.env

View File

@ -2,8 +2,7 @@ require "test_helper"
class ChefSoloProvisionerTest < Test::Unit::TestCase
setup do
@action_env = Vagrant::Action::Environment.new(vagrant_env)
@action_env.env.vm = mock_vm
@action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
@action = Vagrant::Provisioners::ChefSolo.new(@action_env)
@env = @action.env

View File

@ -2,8 +2,7 @@ require "test_helper"
class ChefProvisionerTest < Test::Unit::TestCase
setup do
@action_env = Vagrant::Action::Environment.new(vagrant_env)
@action_env.env.vm = mock_vm
@action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
@action = Vagrant::Provisioners::Chef.new(@action_env)
@env = @action.env

View File

@ -2,12 +2,10 @@ require "test_helper"
class SshTest < Test::Unit::TestCase
def mock_ssh
@env = vagrant_env
@env = vagrant_env.vms[:default].env
@network_adapters = []
@vm = mock("vm")
@vm.stubs(:network_adapters).returns(@network_adapters)
@env.stubs(:vm).returns(mock_vm(@env))
@env.vm.stubs(:vm).returns(@vm)
@ssh = Vagrant::SSH.new(@env)