summaryrefslogtreecommitdiffstats
path: root/spec/unit/interfaces_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/interfaces_spec.rb')
-rwxr-xr-xspec/unit/interfaces_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/interfaces_spec.rb b/spec/unit/interfaces_spec.rb
new file mode 100755
index 0000000..8b295d6
--- /dev/null
+++ b/spec/unit/interfaces_spec.rb
@@ -0,0 +1,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