summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-12-10 14:46:30 -0800
committerJesse Wolfe <jes5199@gmail.com>2010-12-10 14:46:30 -0800
commit56c91fb2accc7c6e53ab8d3c0c60812674c1676a (patch)
treec57aef9866dfcc8f4c5b31b596e8c4f0ef7a3493
parent5c8489be9c3ee62c14b524a6d0d4a96dca5b9764 (diff)
parent54a1025da96aed794e64080e58a7473afccef5b2 (diff)
downloadpuppet-56c91fb2accc7c6e53ab8d3c0c60812674c1676a.tar.gz
puppet-56c91fb2accc7c6e53ab8d3c0c60812674c1676a.tar.xz
puppet-56c91fb2accc7c6e53ab8d3c0c60812674c1676a.zip
Merge branch 'maint/2.6.next/fix-silent-mocha-failures' into 2.6.next
-rw-r--r--lib/puppet/configurer/plugin_handler.rb4
-rwxr-xr-xspec/unit/configurer/plugin_handler_spec.rb2
-rwxr-xr-xspec/unit/configurer_spec.rb2
-rwxr-xr-xspec/unit/file_serving/fileset_spec.rb1
-rwxr-xr-xspec/unit/indirector/ssl_file_spec.rb10
-rwxr-xr-xspec/unit/provider/service/init_spec.rb2
-rwxr-xr-xspec/unit/type/file/source_spec.rb2
-rwxr-xr-xspec/unit/type/file_spec.rb2
8 files changed, 13 insertions, 12 deletions
diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb
index 539441e75..8192d4719 100644
--- a/lib/puppet/configurer/plugin_handler.rb
+++ b/lib/puppet/configurer/plugin_handler.rb
@@ -19,9 +19,7 @@ module Puppet::Configurer::PluginHandler
begin
Puppet.info "Loading downloaded plugin #{file}"
load file
- rescue SystemExit,NoMemoryError
- raise
- rescue Exception => detail
+ rescue StandardError, LoadError => detail
Puppet.err "Could not load downloaded file #{file}: #{detail}"
end
end
diff --git a/spec/unit/configurer/plugin_handler_spec.rb b/spec/unit/configurer/plugin_handler_spec.rb
index 25d2d47af..1423ae4b5 100755
--- a/spec/unit/configurer/plugin_handler_spec.rb
+++ b/spec/unit/configurer/plugin_handler_spec.rb
@@ -80,7 +80,7 @@ describe Puppet::Configurer::PluginHandler do
end
it "should not try to load files that don't exist" do
- FileTest.expects(:exist?).with("foo").returns true
+ FileTest.expects(:exist?).with("foo").returns false
@pluginhandler.expects(:load).never
@pluginhandler.load_plugin("foo")
diff --git a/spec/unit/configurer_spec.rb b/spec/unit/configurer_spec.rb
index 0c9d06362..ebc5768ea 100755
--- a/spec/unit/configurer_spec.rb
+++ b/spec/unit/configurer_spec.rb
@@ -418,7 +418,7 @@ describe Puppet::Configurer, "when retrieving a catalog" do
end
it "should return nil if there is an error while retrieving the catalog" do
- Puppet::Resource::Catalog.expects(:find).raises "eh"
+ Puppet::Resource::Catalog.expects(:find).at_least_once.raises "eh"
@agent.retrieve_catalog.should be_nil
end
diff --git a/spec/unit/file_serving/fileset_spec.rb b/spec/unit/file_serving/fileset_spec.rb
index 9a90cff15..ecc77812c 100755
--- a/spec/unit/file_serving/fileset_spec.rb
+++ b/spec/unit/file_serving/fileset_spec.rb
@@ -306,6 +306,7 @@ end
describe Puppet::FileServing::Fileset, "when merging other filesets" do
before do
@paths = %w{/first/path /second/path /third/path}
+ File.stubs(:lstat).returns stub("stat", :directory? => false)
@filesets = @paths.collect do |path|
File.stubs(:lstat).with(path).returns stub("stat", :directory? => true)
diff --git a/spec/unit/indirector/ssl_file_spec.rb b/spec/unit/indirector/ssl_file_spec.rb
index 83145cffc..37098a7a9 100755
--- a/spec/unit/indirector/ssl_file_spec.rb
+++ b/spec/unit/indirector/ssl_file_spec.rb
@@ -18,12 +18,12 @@ describe Puppet::Indirector::SslFile do
end
end
- @setting = :mydir
+ @setting = :certdir
@file_class.store_in @setting
- @path = "/my/directory"
- Puppet.settings.stubs(:value).with(:noop).returns(false)
- Puppet.settings.stubs(:value).with(@setting).returns(@path)
- Puppet.settings.stubs(:value).with(:trace).returns(false)
+ @path = "/tmp/my_directory"
+ Puppet[:noop] = false
+ Puppet[@setting] = @path
+ Puppet[:trace] = false
end
it "should use :main and :ssl upon initialization" do
diff --git a/spec/unit/provider/service/init_spec.rb b/spec/unit/provider/service/init_spec.rb
index bbc88ff76..856821985 100755
--- a/spec/unit/provider/service/init_spec.rb
+++ b/spec/unit/provider/service/init_spec.rb
@@ -84,10 +84,12 @@ describe provider_class do
end
it "should be able to find the init script in the service path" do
+ File.stubs(:stat).raises(Errno::ENOENT.new('No such file or directory'))
File.expects(:stat).with("/service/path/myservice").returns true
@provider.initscript.should == "/service/path/myservice"
end
it "should be able to find the init script in the service path" do
+ File.stubs(:stat).raises(Errno::ENOENT.new('No such file or directory'))
File.expects(:stat).with("/alt/service/path/myservice").returns true
@provider.initscript.should == "/alt/service/path/myservice"
end
diff --git a/spec/unit/type/file/source_spec.rb b/spec/unit/type/file/source_spec.rb
index 522ae1f0e..00cc2f235 100755
--- a/spec/unit/type/file/source_spec.rb
+++ b/spec/unit/type/file/source_spec.rb
@@ -6,7 +6,7 @@ source = Puppet::Type.type(:file).attrclass(:source)
describe Puppet::Type.type(:file).attrclass(:source) do
before do
# Wow that's a messy interface to the resource.
- @resource = stub 'resource', :[]= => nil, :property => nil, :catalog => stub("catalog", :dependent_data_expired? => false)
+ @resource = stub 'resource', :[]= => nil, :property => nil, :catalog => stub("catalog", :dependent_data_expired? => false), :line => 0, :file => ''
end
it "should be a subclass of Parameter" do
diff --git a/spec/unit/type/file_spec.rb b/spec/unit/type/file_spec.rb
index 7d93dfd64..4fcad07e1 100755
--- a/spec/unit/type/file_spec.rb
+++ b/spec/unit/type/file_spec.rb
@@ -71,7 +71,7 @@ describe Puppet::Type.type(:file) do
before { @file.stubs(:validate_checksum?).returns(true) }
it "should fail if the checksum parameter and content checksums do not match" do
- checksum = stub('checksum_parameter', :sum => 'checksum_b')
+ checksum = stub('checksum_parameter', :sum => 'checksum_b', :sum_file => 'checksum_b')
@file.stubs(:parameter).with(:checksum).returns(checksum)
property = stub('content_property', :actual_content => "something", :length => "something".length, :write => 'checksum_a')