summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2010-11-22 11:25:14 -0800
committerNick Lewis <nick@puppetlabs.com>2010-11-22 11:27:17 -0800
commit9d990797e9f787aca5bbcc3f1698d9cd00336bf6 (patch)
tree6d4c0f7f5450f4d73519f4edf06098642006efe3
parentc7d85a30ec68989ac3367d2a71afb99d865a984d (diff)
downloadfacter-9d990797e9f787aca5bbcc3f1698d9cd00336bf6.tar.gz
facter-9d990797e9f787aca5bbcc3f1698d9cd00336bf6.tar.xz
facter-9d990797e9f787aca5bbcc3f1698d9cd00336bf6.zip
maint: Fix spec failures caused by having a space in the path to facter's source
-rw-r--r--spec/unit/util/macaddress.rb6
-rw-r--r--spec/unit/util/uptime.rb6
2 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/util/macaddress.rb b/spec/unit/util/macaddress.rb
index 8349b36..1ccca18 100644
--- a/spec/unit/util/macaddress.rb
+++ b/spec/unit/util/macaddress.rb
@@ -25,7 +25,7 @@ context "Darwin" do
context "when netstat has a default interface" do
before do
- Facter::Util::Macaddress::Darwin.stubs(:netstat_command).returns("cat #{netstat_file}")
+ Facter::Util::Macaddress::Darwin.stubs(:netstat_command).returns("cat \"#{netstat_file}\"")
end
it "should return the default interface name" do
@@ -40,7 +40,7 @@ context "Darwin" do
before do
Facter.stubs(:warn)
Facter::Util::Macaddress::Darwin.stubs(:default_interface).returns('')
- Facter::Util::Macaddress::Darwin.stubs(:ifconfig_command).returns("cat #{ifconfig_file}")
+ Facter::Util::Macaddress::Darwin.stubs(:ifconfig_command).returns("cat \"#{ifconfig_file}\"")
end
it "should return the macaddress of the default interface" do
@@ -52,7 +52,7 @@ context "Darwin" do
context "when netstat does not have a default interface" do
before do
Facter::Util::Macaddress::Darwin.stubs(:default_interface).returns("")
- Facter::Util::Macaddress::Darwin.stubs(:ifconfig_command).returns("cat #{ifconfig_file_no_iface}")
+ Facter::Util::Macaddress::Darwin.stubs(:ifconfig_command).returns("cat \"#{ifconfig_file_no_iface}\"")
end
it "should warn about the lack of default" do
diff --git a/spec/unit/util/uptime.rb b/spec/unit/util/uptime.rb
index 9ba6665..72c97ed 100644
--- a/spec/unit/util/uptime.rb
+++ b/spec/unit/util/uptime.rb
@@ -10,7 +10,7 @@ describe Facter::Util::Uptime do
context "when /proc/uptime is available" do
before do
uptime_file = File.join(SPECDIR, "fixtures", "uptime", "ubuntu_proc_uptime")
- Facter::Util::Uptime.stubs(:uptime_file).returns(uptime_file)
+ Facter::Util::Uptime.stubs(:uptime_file).returns("\"#{uptime_file}\"")
end
it "should return the uptime in seconds as an integer" do
@@ -24,7 +24,7 @@ describe Facter::Util::Uptime do
File.exists?(nonexistent_file).should == false
Facter::Util::Uptime.stubs(:uptime_file).returns(nonexistent_file)
sysctl_output_file = File.join(SPECDIR, 'fixtures', 'uptime', 'sysctl_kern_boottime') # Aug 01 14:13:47 -0700 2010
- Facter::Util::Uptime.stubs(:uptime_sysctl_cmd).returns("cat #{sysctl_output_file}")
+ Facter::Util::Uptime.stubs(:uptime_sysctl_cmd).returns("cat \"#{sysctl_output_file}\"")
Time.stubs(:now).returns Time.parse("Aug 01 15:13:47 -0700 2010") # one hour later
Facter::Util::Uptime.get_uptime_seconds_unix.should == 60 * 60
end
@@ -35,7 +35,7 @@ describe Facter::Util::Uptime do
Facter::Util::Uptime.stubs(:uptime_file).returns(nonexistent_file)
Facter::Util::Uptime.stubs(:uptime_sysctl_cmd).returns("cat #{nonexistent_file}")
who_b_output_file = File.join(SPECDIR, 'fixtures', 'uptime', 'who_b_boottime') # Aug 1 14:13
- Facter::Util::Uptime.stubs(:uptime_who_cmd).returns("cat #{who_b_output_file}")
+ Facter::Util::Uptime.stubs(:uptime_who_cmd).returns("cat \"#{who_b_output_file}\"")
Time.stubs(:now).returns Time.parse("Aug 01 15:13") # one hour later
Facter::Util::Uptime.get_uptime_seconds_unix.should == 60 * 60
end