Sha256: 8d94863fdc5b80b76ebe94d1075fe01ef1a652a4976490eb06e16d263684acf3

Contents?: true

Size: 817 Bytes

Versions: 32

Compression:

Stored size: 817 Bytes

Contents

require File.expand_path("../../../base", __FILE__)

require "vagrant/util/network_ip"

describe Vagrant::Util::NetworkIP do
  let(:klass) do
    Class.new do
      extend Vagrant::Util::NetworkIP
    end
  end

  describe "network address" do
    it "calculates it properly" do
      expect(klass.network_address("192.168.2.234", "255.255.255.0")).to eq("192.168.2.0")
    end

    it "calculates it properly with integer submask" do
      expect(klass.network_address("192.168.2.234", "24")).to eq("192.168.2.0")
    end

    it "calculates it properly for IPv6" do
      expect(klass.network_address("fde4:8dba:82e1::c4", "64")).to eq("fde4:8dba:82e1::")
    end

    it "calculates it properly for IPv6" do
      expect(klass.network_address("fde4:8dba:82e1::c4", 64)).to eq("fde4:8dba:82e1::")
    end
  end
end

Version data entries

32 entries across 28 versions & 5 rubygems

Version Path
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/vagrant/util/network_ip_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/vagrant/util/network_ip_test.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/vagrant/util/network_ip_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/vagrant/util/network_ip_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/vagrant/util/network_ip_test.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/test/unit/vagrant/util/network_ip_test.rb
vagrant-unbundled-2.0.2.0 test/unit/vagrant/util/network_ip_test.rb
vagrant-unbundled-2.0.1.0 test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/test/unit/vagrant/util/network_ip_test.rb
vagrant-unbundled-2.0.0.1 test/unit/vagrant/util/network_ip_test.rb
vagrant-unbundled-1.9.8.1 test/unit/vagrant/util/network_ip_test.rb
vagrant-unbundled-1.9.7.1 test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/vagrant/util/network_ip_test.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/test/unit/vagrant/util/network_ip_test.rb