Sha256: 052782f9bf8f20f115cb224ee7bc51b7293bdbac95e36c711425a2e969ef4184

Contents?: true

Size: 754 Bytes

Versions: 14

Compression:

Stored size: 754 Bytes

Contents

#!/usr/bin/env rspec

require 'spec_helper'
require 'facter/util/ip'

describe "Per Interface IP facts" do
  it "should replace the ':' in an interface list with '_'" do
    # So we look supported
    Facter.fact(:kernel).stubs(:value).returns("SunOS")

    Facter::Util::IP.stubs(:get_interfaces).returns %w{eth0:1 eth1:2}
    Facter.fact(:interfaces).value.should == %{eth0_1,eth1_2}
  end

  it "should replace non-alphanumerics in an interface list with '_'" do
    Facter.fact(:kernel).stubs(:value).returns("windows")

    Facter::Util::IP.stubs(:get_interfaces).returns ["Local Area Connection", "Loopback \"Pseudo-Interface\" (#1)"]
    Facter.fact(:interfaces).value.should == %{Local_Area_Connection,Loopback__Pseudo_Interface____1_}
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
facter-1.6.13 spec/unit/interfaces_spec.rb
facter-1.6.13.rc1 spec/unit/interfaces_spec.rb
facter-1.6.12 spec/unit/interfaces_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/facter-1.6.11/spec/unit/interfaces_spec.rb
facter-1.6.12.rc2 spec/unit/interfaces_spec.rb
facter-1.6.12.rc1 spec/unit/interfaces_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/facter-1.6.11/spec/unit/interfaces_spec.rb
facter-1.6.11 spec/unit/interfaces_spec.rb
facter-1.6.10 spec/unit/interfaces_spec.rb
facter-1.6.9 spec/unit/interfaces_spec.rb
facter-1.6.8 spec/unit/interfaces_spec.rb
facter-1.6.7 spec/unit/interfaces_spec.rb
facter-1.6.6 spec/unit/interfaces_spec.rb
facter-1.6.5 spec/unit/interfaces_spec.rb