From 7a8be1677314ce3db6ae6590ae7d32a10605c8d3 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Thu, 27 Jan 2011 17:17:52 -0800 Subject: Refactor #6044 -- use _spec.rb as the pattern for spec tests. Rename all the spec tests to follow the rspec convention of *_spec.rb rather than unadorned *.rb; this also makes it easier to work with them consistently without using the Rakefile support that customizes that. --- spec/unit/interfaces_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 spec/unit/interfaces_spec.rb (limited to 'spec/unit/interfaces_spec.rb') 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 -- cgit