diff options
-rwxr-xr-x | spec/unit/application/agent_spec.rb | 8 | ||||
-rwxr-xr-x | spec/unit/application/apply_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/master_spec.rb | 19 |
3 files changed, 27 insertions, 2 deletions
diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb index cee6a0d1a..be397073c 100755 --- a/spec/unit/application/agent_spec.rb +++ b/spec/unit/application/agent_spec.rb @@ -293,6 +293,14 @@ describe Puppet::Application::Agent do @puppetd.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 install a remote ca location" do Puppet::SSL::Host.expects(:ca_location=).with(:remote) diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb index e2b6ff5ab..6451195fc 100755 --- a/spec/unit/application/apply_spec.rb +++ b/spec/unit/application/apply_spec.rb @@ -177,7 +177,7 @@ describe Puppet::Application::Apply do describe "the main command" do before :each do Puppet.stubs(:[]) - Puppet.settings.stubs(:use) + Puppet::Util::Settings.any_instance.stubs(:use) Puppet.stubs(:[]).with(:prerun_command).returns "" Puppet.stubs(:[]).with(:postrun_command).returns "" Puppet.stubs(:[]).with(:trace).returns(true) diff --git a/spec/unit/application/master_spec.rb b/spec/unit/application/master_spec.rb index cf8593108..ea52b2f47 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) |