Removed `mock_vm` test helper, which is unnecessary
This commit is contained in:
parent
e5be4cc2b0
commit
3fe785ab72
|
@ -23,15 +23,6 @@ I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
|
||||||
class Test::Unit::TestCase
|
class Test::Unit::TestCase
|
||||||
include Vagrant::TestHelpers
|
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
|
# Sets up the mocks and stubs for a downloader
|
||||||
def mock_downloader(downloader_klass)
|
def mock_downloader(downloader_klass)
|
||||||
tempfile = mock("tempfile")
|
tempfile = mock("tempfile")
|
||||||
|
|
|
@ -2,8 +2,7 @@ require "test_helper"
|
||||||
|
|
||||||
class ChefServerProvisionerTest < Test::Unit::TestCase
|
class ChefServerProvisionerTest < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
@action_env = Vagrant::Action::Environment.new(vagrant_env)
|
@action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
|
||||||
@action_env.env.vm = mock_vm
|
|
||||||
|
|
||||||
@action = Vagrant::Provisioners::ChefServer.new(@action_env)
|
@action = Vagrant::Provisioners::ChefServer.new(@action_env)
|
||||||
@env = @action.env
|
@env = @action.env
|
||||||
|
|
|
@ -2,8 +2,7 @@ require "test_helper"
|
||||||
|
|
||||||
class ChefSoloProvisionerTest < Test::Unit::TestCase
|
class ChefSoloProvisionerTest < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
@action_env = Vagrant::Action::Environment.new(vagrant_env)
|
@action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
|
||||||
@action_env.env.vm = mock_vm
|
|
||||||
|
|
||||||
@action = Vagrant::Provisioners::ChefSolo.new(@action_env)
|
@action = Vagrant::Provisioners::ChefSolo.new(@action_env)
|
||||||
@env = @action.env
|
@env = @action.env
|
||||||
|
|
|
@ -2,8 +2,7 @@ require "test_helper"
|
||||||
|
|
||||||
class ChefProvisionerTest < Test::Unit::TestCase
|
class ChefProvisionerTest < Test::Unit::TestCase
|
||||||
setup do
|
setup do
|
||||||
@action_env = Vagrant::Action::Environment.new(vagrant_env)
|
@action_env = Vagrant::Action::Environment.new(vagrant_env.vms[:default].env)
|
||||||
@action_env.env.vm = mock_vm
|
|
||||||
|
|
||||||
@action = Vagrant::Provisioners::Chef.new(@action_env)
|
@action = Vagrant::Provisioners::Chef.new(@action_env)
|
||||||
@env = @action.env
|
@env = @action.env
|
||||||
|
|
|
@ -2,12 +2,10 @@ require "test_helper"
|
||||||
|
|
||||||
class SshTest < Test::Unit::TestCase
|
class SshTest < Test::Unit::TestCase
|
||||||
def mock_ssh
|
def mock_ssh
|
||||||
@env = vagrant_env
|
@env = vagrant_env.vms[:default].env
|
||||||
@network_adapters = []
|
@network_adapters = []
|
||||||
@vm = mock("vm")
|
@vm = mock("vm")
|
||||||
@vm.stubs(:network_adapters).returns(@network_adapters)
|
@vm.stubs(:network_adapters).returns(@network_adapters)
|
||||||
|
|
||||||
@env.stubs(:vm).returns(mock_vm(@env))
|
|
||||||
@env.vm.stubs(:vm).returns(@vm)
|
@env.vm.stubs(:vm).returns(@vm)
|
||||||
|
|
||||||
@ssh = Vagrant::SSH.new(@env)
|
@ssh = Vagrant::SSH.new(@env)
|
||||||
|
|
Loading…
Reference in New Issue