diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-01-06 15:56:16 -0800 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-01-06 15:56:16 -0800 |
| commit | c7764723578ae64240db7bd2a64f8e6e9fa708ab (patch) | |
| tree | 2b2da51df7a7875c3d3820c2bfa02d3e98ccdd8d | |
| parent | fb8509acbd947712cac094a49227d28a16a366aa (diff) | |
| parent | 7ed5251f80b0e37caf6e255875860157f95ee935 (diff) | |
| download | puppet-c7764723578ae64240db7bd2a64f8e6e9fa708ab.tar.gz puppet-c7764723578ae64240db7bd2a64f8e6e9fa708ab.tar.xz puppet-c7764723578ae64240db7bd2a64f8e6e9fa708ab.zip | |
Merge branch 'maint/next/mocha_workaround' into next
| -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) |
