summaryrefslogtreecommitdiffstats
path: root/spec/unit/interfaces_spec.rb
blob: 8b295d67cbf47ffb206d9e36c964edc3090a05ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

require 'facter'

describe "Per Interface IP facts" do
    before do
        Facter.loadfacts
    end

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

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