Skip to content

Commit

Permalink
Removed mock_vm test helper, which is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Oct 4, 2010
1 parent e5be4cc commit 3fe785a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
9 changes: 0 additions & 9 deletions test/test_helper.rb
Expand Up @@ -23,15 +23,6 @@
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")
Expand Down
3 changes: 1 addition & 2 deletions test/vagrant/provisioners/chef_server_test.rb
Expand Up @@ -2,8 +2,7 @@

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
Expand Down
3 changes: 1 addition & 2 deletions test/vagrant/provisioners/chef_solo_test.rb
Expand Up @@ -2,8 +2,7 @@

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
Expand Down
3 changes: 1 addition & 2 deletions test/vagrant/provisioners/chef_test.rb
Expand Up @@ -2,8 +2,7 @@

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
Expand Down
4 changes: 1 addition & 3 deletions test/vagrant/ssh_test.rb
Expand Up @@ -2,12 +2,10 @@

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)
Expand Down

0 comments on commit 3fe785a

Please sign in to comment.