File: interfaces.rb

package info (click to toggle)
facter 1.5.7-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 692 kB
  • ctags: 202
  • sloc: ruby: 3,977; sh: 108; makefile: 53
file content (19 lines) | stat: -rw-r--r-- 487 bytes parent folder | download
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.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