summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lathrop <paul@tertiusfamily.net>2008-05-21 18:29:25 -0700
committerJames Turnbull <james@lovedthanlost.net>2008-05-23 04:19:59 +1000
commitbdcf5db3cea4a4009839087c1b502dcce24eddd7 (patch)
tree39fe719b4a094b6b8bd5cd44af29f034d6876d3c
parentd55a75525ad931aaeab87fd9173f9e92df000ed9 (diff)
downloadpuppet-bdcf5db3cea4a4009839087c1b502dcce24eddd7.tar.gz
puppet-bdcf5db3cea4a4009839087c1b502dcce24eddd7.tar.xz
puppet-bdcf5db3cea4a4009839087c1b502dcce24eddd7.zip
Fixing tests that are broken when running as root under OSX 10.5
-rwxr-xr-xspec/unit/indirector/report/processor.rb4
-rw-r--r--spec/unit/network/client.rb2
-rwxr-xr-xspec/unit/network/client/master.rb2
-rwxr-xr-xspec/unit/util/storage.rb7
4 files changed, 13 insertions, 2 deletions
diff --git a/spec/unit/indirector/report/processor.rb b/spec/unit/indirector/report/processor.rb
index bcb400bda..3ee9b1b5e 100755
--- a/spec/unit/indirector/report/processor.rb
+++ b/spec/unit/indirector/report/processor.rb
@@ -8,6 +8,10 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppet/indirector/report/processor'
describe Puppet::Transaction::Report::Processor do
+ before do
+ Puppet.settings.stubs(:use).returns(true)
+ end
+
it "should provide a method for saving reports" do
Puppet::Transaction::Report::Processor.new.should respond_to(:save)
end
diff --git a/spec/unit/network/client.rb b/spec/unit/network/client.rb
index bc41efb4f..e9467aad0 100644
--- a/spec/unit/network/client.rb
+++ b/spec/unit/network/client.rb
@@ -9,8 +9,10 @@ require 'puppet/network/client'
describe Puppet::Network::Client do
before do
+ Puppet.settings.stubs(:use).returns(true)
Puppet::Network::HttpPool.stubs(:cert_setup)
end
+
describe "when keep-alive is enabled" do
before do
Puppet::Network::HttpPool.stubs(:keep_alive?).returns true
diff --git a/spec/unit/network/client/master.rb b/spec/unit/network/client/master.rb
index c0ad7562f..79ab8c86f 100755
--- a/spec/unit/network/client/master.rb
+++ b/spec/unit/network/client/master.rb
@@ -8,6 +8,7 @@ require 'puppet/network/client/master'
describe Puppet::Network::Client::Master, " when retrieving the catalog" do
before do
+ Puppet.settings.stubs(:use).returns(true)
@master = mock 'master'
@client = Puppet::Network::Client.master.new(
:Master => @master
@@ -218,6 +219,7 @@ end
describe Puppet::Network::Client::Master, " when using the cached catalog" do
before do
+ Puppet.settings.stubs(:use).returns(true)
@master = mock 'master'
@client = Puppet::Network::Client.master.new(
:Master => @master
diff --git a/spec/unit/util/storage.rb b/spec/unit/util/storage.rb
index 90625bd71..b2c350267 100755
--- a/spec/unit/util/storage.rb
+++ b/spec/unit/util/storage.rb
@@ -85,7 +85,7 @@ describe Puppet::Util::Storage do
end
describe "when loading from the state file" do
- before(:each) do
+ before do
Puppet.settings.stubs(:use).returns(true)
end
@@ -143,6 +143,7 @@ describe Puppet::Util::Storage do
it "should initialize with a clear internal state if the state file does not contain valid YAML" do
@state_file.write(:booness)
+ @state_file.flush()
proc { Puppet::Util::Storage.load() }.should_not raise_error()
Puppet::Util::Storage.state().should == {}
@@ -150,7 +151,9 @@ describe Puppet::Util::Storage do
it "should raise an error if the state file does not contain valid YAML and cannot be renamed" do
@state_file.write(:booness)
- File.chmod(0000, @state_file.path())
+ @state_file.flush()
+ YAML.expects(:load).raises(Puppet::Error)
+ File.expects(:rename).raises(SystemCallError)
proc { Puppet::Util::Storage.load() }.should raise_error()
end