Sha256: b1169f632ccdf3bab1bada6300e2e114211809129c3b4c0b067410f4284bab19

Contents?: true

Size: 729 Bytes

Versions: 4

Compression:

Stored size: 729 Bytes

Contents

require "test_helper"

class MatchMACAddressVMActionTest < Test::Unit::TestCase
  setup do
    @klass = Vagrant::Action::VM::MatchMACAddress
    @app, @env = mock_action_data

    @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)
    @internal_vm.expects(:save).once.in_sequence(update_seq)
    @app.expects(:call).with(@env).once.in_sequence(update_seq)

    @instance.call(@env)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vagrantup-0.5.4 test/vagrant/action/vm/match_mac_address_test.rb
vagrantup-0.5.3 test/vagrant/action/vm/match_mac_address_test.rb
vagrant-0.5.4 test/vagrant/action/vm/match_mac_address_test.rb
vagrant-0.5.3 test/vagrant/action/vm/match_mac_address_test.rb