Sha256: d0cb72eb1e3fcb94415909a5af4fa8544826490ae5bae27c2b5fd6a05e1a0b9f

Contents?: true

Size: 973 Bytes

Versions: 6

Compression:

Stored size: 973 Bytes

Contents

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

require "vagrant/util/template_renderer"

describe "templates/guests/arch/network_static" do
  let(:template) { "guests/arch/network_static" }

  it "renders the template" do
    result = Vagrant::Util::TemplateRenderer.render(template, options: {
      device: "eth1",
      ip:     "1.1.1.1",
    })
    expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
      Connection=ethernet
      Description='A basic static ethernet connection'
      Interface=eth1
      IP=static
      Address=('1.1.1.1/24')
    EOH
  end

  it "includes the gateway" do
    result = Vagrant::Util::TemplateRenderer.render(template, options: {
      device:  "eth1",
      ip:      "1.1.1.1",
      gateway: "1.2.3.4",
    })
    expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
      Connection=ethernet
      Description='A basic static ethernet connection'
      Interface=eth1
      IP=static
      Address=('1.1.1.1/24')
      Gateway='1.2.3.4'
    EOH
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/templates/guests/arch/network_static_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/templates/guests/arch/network_static_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/templates/guests/arch/network_static_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/templates/guests/arch/network_static_test.rb
vagrant-unbundled-1.8.4.2 test/unit/templates/guests/arch/network_static_test.rb
vagrant-unbundled-1.8.4.1 test/unit/templates/guests/arch/network_static_test.rb