From af81fb37853802bf35e0af8f94988547633f538b Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Wed, 13 Aug 2008 15:55:49 +0100 Subject: Extract ifconfig output to data directory --- .../data/linux_ifconfig_all_with_single_interface | 18 +++++++++++++++ spec/unit/util/ip.rb | 26 ++++------------------ 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 spec/unit/data/linux_ifconfig_all_with_single_interface diff --git a/spec/unit/data/linux_ifconfig_all_with_single_interface b/spec/unit/data/linux_ifconfig_all_with_single_interface new file mode 100644 index 0000000..e063b77 --- /dev/null +++ b/spec/unit/data/linux_ifconfig_all_with_single_interface @@ -0,0 +1,18 @@ +eth0 Link encap:Ethernet HWaddr 00:0c:29:52:15:e9 + inet addr:172.16.15.133 Bcast:172.16.15.255 Mask:255.255.255.0 + inet6 addr: fe80::20c:29ff:fe52:15e9/64 Scope:Link + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:173 errors:173 dropped:0 overruns:0 frame:0 + TX packets:208 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:40970 (40.0 KB) TX bytes:24760 (24.1 KB) + Interrupt:16 Base address:0x2024 + +lo Link encap:Local Loopback + inet addr:127.0.0.1 Mask:255.0.0.0 + inet6 addr: ::1/128 Scope:Host + UP LOOPBACK RUNNING MTU:16436 Metric:1 + RX packets:1630 errors:0 dropped:0 overruns:0 frame:0 + TX packets:1630 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:81500 (79.5 KB) TX bytes:81500 (79.5 KB) \ No newline at end of file diff --git a/spec/unit/util/ip.rb b/spec/unit/util/ip.rb index b517b4e..47ec951 100644 --- a/spec/unit/util/ip.rb +++ b/spec/unit/util/ip.rb @@ -12,32 +12,14 @@ describe Facter::IPAddress do it "should return an empty list of interfaces on an unknown kernel" do Facter.stubs(:value).returns("UnknownKernel") - assert_equal [], Facter::IPAddress.get_interfaces() + Facter::IPAddress.get_interfaces().should == [] end it "should return a list with a single interface on Linux with a single interface" do - linux_ifconfig = <