Sha256: 2018f61ae81e3db264a769ac9693e02ab36eb69ac94e46cdf1f31bd8c8bd088a

Contents?: true

Size: 1.18 KB

Versions: 26

Compression:

Stored size: 1.18 KB

Contents

require_relative "../../../../base"

describe "VagrantPlugins::GuestSlackware::Cap::ConfigureNetworks" do
  let(:caps) do
    VagrantPlugins::GuestSlackware::Plugin
      .components
      .guest_capabilities[:slackware]
  end

  let(:guest) { double("guest") }
  let(:machine) { double("machine", guest: guest) }
  let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }

  before do
    allow(machine).to receive(:communicate).and_return(comm)
  end

  after do
    comm.verify_expectations!
  end

  describe ".configure_networks" do
    let(:cap) { caps.get(:configure_networks) }

    before do
      allow(guest).to receive(:capability).with(:network_interfaces)
        .and_return(["eth1", "eth2"])
    end

    let(:network_1) do
      {
        interface: 0,
        type: "dhcp",
      }
    end

    let(:network_2) do
      {
        interface: 1,
        type: "static",
        ip: "33.33.33.10",
        netmask: "255.255.0.0",
        gateway: "33.33.0.1",
      }
    end

    it "creates and starts the networks" do
      cap.configure_networks(machine, [network_1, network_2])
      expect(comm.received_commands[0]).to match(/\/etc\/rc.d\/rc.inet1/)
    end
  end
end

Version data entries

26 entries across 22 versions & 5 rubygems

Version Path
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-unbundled-2.0.2.0 test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-unbundled-2.0.1.0 test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-unbundled-2.0.0.1 test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-unbundled-1.9.8.1 test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-unbundled-1.9.7.1 test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb