summaryrefslogtreecommitdiffstats
path: root/spec/unit/application/master_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/application/master_spec.rb')
-rw-r--r--spec/unit/application/master_spec.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/spec/unit/application/master_spec.rb b/spec/unit/application/master_spec.rb
index cf8593108..1cf06ffa6 100644
--- a/spec/unit/application/master_spec.rb
+++ b/spec/unit/application/master_spec.rb
@@ -119,7 +119,7 @@ describe Puppet::Application::Master do
Puppet::Log.stubs(:level=)
Puppet::SSL::CertificateAuthority.stubs(:instance)
Puppet::SSL::CertificateAuthority.stubs(:ca?)
- Puppet.settings.stubs(:use)
+ Puppet::Util::Settings.any_instance.stubs(:use)
@master.options.stubs(:[]).with(any_parameters)
end
@@ -183,6 +183,14 @@ describe Puppet::Application::Master do
@master.setup
end
+ it "mocha work-around" do
+ # Mocha 0.9.10 and earlier leaves behind a bogus "use" method
+ # See https://github.com/floehopper/mocha/issues#issue/20
+ class << Puppet.settings
+ remove_method :use rescue nil
+ end
+ end
+
it "should cache class in yaml" do
Puppet::Node.indirection.expects(:cache_class=).with(:yaml)
@@ -212,11 +220,20 @@ describe Puppet::Application::Master do
end
it "should tell Puppet.settings to use :ca category" do
+ Puppet.settings.stubs(:use)
Puppet.settings.expects(:use).with(:ca)
@master.setup
end
+ it "mocha work-around" do
+ # Mocha 0.9.10 and earlier leaves behind a bogus "use" method
+ # See https://github.com/floehopper/mocha/issues#issue/20
+ class << Puppet.settings
+ remove_method :use rescue nil
+ end
+ end
+
it "should instantiate the CertificateAuthority singleton" do
Puppet::SSL::CertificateAuthority.expects(:instance)
@@ -412,9 +429,7 @@ describe Puppet::Application::Master do
@master.main
end
- describe "with --rack" do
- confine "Rack is not available" => Puppet.features.rack?
-
+ describe "with --rack", :if => Puppet.features.rack? do
before do
require 'puppet/network/http/rack'
Puppet::Network::HTTP::Rack.stubs(:new).returns(@app)