Sha256: 2319a63526fcbb57842a10b33c2f2bab462a9d317c56b814743cdfda40fd6ba7
Contents?: true
Size: 974 Bytes
Versions: 59
Compression:
Stored size: 974 Bytes
Contents
require "test_helper" class MatchMACAddressVMActionTest < Test::Unit::TestCase setup do @klass = Vagrant::Action::VM::MatchMACAddress @app, @env = action_env @vm = mock("vm") @env["vm"] = @vm @internal_vm = mock("internal") @vm.stubs(:vm).returns(@internal_vm) @instance = @klass.new(@app, @env) end should "match the mac addresses" do nic = mock("nic") nic.expects(:mac_address=).once update_seq = sequence("update_seq") @internal_vm.expects(:network_adapters).returns([nic]).once.in_sequence(update_seq) @app.expects(:call).with(@env).once.in_sequence(update_seq) @env["vm.modify"].expects(:call).with() do |proc| proc.call(@internal_vm) true end @instance.call(@env) end should "raise an exception if no base MAC address is specified" do @env.env.config.vm.base_mac = nil assert_raises(Vagrant::Errors::VMBaseMacNotSpecified) { @instance.call(@env) } end end
Version data entries
59 entries across 59 versions & 7 rubygems