diff options
author | Luke Kanies <luke@madstop.com> | 2009-02-18 22:37:09 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-18 22:37:09 -0600 |
commit | 4a7cba3f2ed634c49bdfb2c3aba7153668c6afd0 (patch) | |
tree | b88d01a09f1f48aad1a2f41ef1e8c5d2c6303c91 | |
parent | 3105b5bb33639fb8a39234adfa84f354e7189785 (diff) | |
download | puppet-4a7cba3f2ed634c49bdfb2c3aba7153668c6afd0.tar.gz puppet-4a7cba3f2ed634c49bdfb2c3aba7153668c6afd0.tar.xz puppet-4a7cba3f2ed634c49bdfb2c3aba7153668c6afd0.zip |
Stubbing tests that were affecting other tests
These stubs are all for global configuration state.
It's a known problem that these have to be stubbed,
but we haven't been able to find a design yet that
fixes this.
At least these tests are no longer breaking other tests.
Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r-- | spec/unit/application/filebucket.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/puppet.rb | 4 | ||||
-rw-r--r-- | spec/unit/application/puppetca.rb | 4 | ||||
-rwxr-xr-x | spec/unit/application/puppetd.rb | 7 | ||||
-rwxr-xr-x | spec/unit/application/puppetdoc.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/puppetmasterd.rb | 11 | ||||
-rwxr-xr-x | spec/unit/application/puppetrun.rb | 2 | ||||
-rw-r--r-- | spec/unit/application/ralsh.rb | 2 |
8 files changed, 30 insertions, 4 deletions
diff --git a/spec/unit/application/filebucket.rb b/spec/unit/application/filebucket.rb index 2ddf78d90..e87bab402 100644 --- a/spec/unit/application/filebucket.rb +++ b/spec/unit/application/filebucket.rb @@ -217,4 +217,4 @@ describe "Filebucket" do end -end
\ No newline at end of file +end diff --git a/spec/unit/application/puppet.rb b/spec/unit/application/puppet.rb index e7a6bb44a..df9aaa4e6 100644 --- a/spec/unit/application/puppet.rb +++ b/spec/unit/application/puppet.rb @@ -7,6 +7,8 @@ require 'puppet/application/puppet' describe "Puppet" do before :each do @puppet = Puppet::Application[:puppet] + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) end [:debug,:execute,:loadclasses,:verbose,:use_nodes,:detailed_exitcodes].each do |option| @@ -290,4 +292,4 @@ describe "Puppet" do end end -end
\ No newline at end of file +end diff --git a/spec/unit/application/puppetca.rb b/spec/unit/application/puppetca.rb index effe0fb9a..38ceacbcc 100644 --- a/spec/unit/application/puppetca.rb +++ b/spec/unit/application/puppetca.rb @@ -7,6 +7,8 @@ require 'puppet/application/puppetca' describe "PuppetCA" do before :each do @puppetca = Puppet::Application[:puppetca] + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) end it "should ask Puppet::Application to parse Puppet configuration file" do @@ -131,4 +133,4 @@ describe "PuppetCA" do end end -end
\ No newline at end of file +end diff --git a/spec/unit/application/puppetd.rb b/spec/unit/application/puppetd.rb index 3abfaf023..592b499ca 100755 --- a/spec/unit/application/puppetd.rb +++ b/spec/unit/application/puppetd.rb @@ -14,6 +14,13 @@ describe "puppetd" do @agent = stub_everything 'agent' Puppet::Agent.stubs(:new).returns(@agent) @puppetd.run_preinit + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) + + Puppet::Node.stubs(:terminus_class=) + Puppet::Node.stubs(:cache_class=) + Puppet::Node::Facts.stubs(:terminus_class=) + Puppet::Node::Facts.stubs(:cache_class=) end it "should ask Puppet::Application to parse Puppet configuration file" do diff --git a/spec/unit/application/puppetdoc.rb b/spec/unit/application/puppetdoc.rb index c7822bed0..2bb74a7fa 100755 --- a/spec/unit/application/puppetdoc.rb +++ b/spec/unit/application/puppetdoc.rb @@ -9,6 +9,8 @@ describe "puppetdoc" do @puppetdoc = Puppet::Application[:puppetdoc] @puppetdoc.stubs(:puts) @puppetdoc.run_preinit + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) end it "should ask Puppet::Application to not parse Puppet configuration file" do diff --git a/spec/unit/application/puppetmasterd.rb b/spec/unit/application/puppetmasterd.rb index 606617d9e..da1b1dd1c 100644 --- a/spec/unit/application/puppetmasterd.rb +++ b/spec/unit/application/puppetmasterd.rb @@ -9,6 +9,15 @@ describe "PuppetMaster" do @puppetmasterd = Puppet::Application[:puppetmasterd] @daemon = stub_everything 'daemon' Puppet::Daemon.stubs(:new).returns(@daemon) + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) + + Puppet::Node.stubs(:terminus_class=) + Puppet::Node.stubs(:cache_class=) + Puppet::Node::Facts.stubs(:terminus_class=) + Puppet::Node::Facts.stubs(:cache_class=) + Puppet::Transaction::Report.stubs(:terminus_class=) + Puppet::Resource::Catalog.stubs(:terminus_class=) end it "should ask Puppet::Application to parse Puppet configuration file" do @@ -325,4 +334,4 @@ describe "PuppetMaster" do end end -end
\ No newline at end of file +end diff --git a/spec/unit/application/puppetrun.rb b/spec/unit/application/puppetrun.rb index 89725027c..2a8ccb84a 100755 --- a/spec/unit/application/puppetrun.rb +++ b/spec/unit/application/puppetrun.rb @@ -9,6 +9,8 @@ describe "puppetrun" do before :each do Puppet::Util::Ldap::Connection.stubs(:new).returns(stub_everything) @puppetrun = Puppet::Application[:puppetrun] + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) end it "should ask Puppet::Application to not parse Puppet configuration file" do diff --git a/spec/unit/application/ralsh.rb b/spec/unit/application/ralsh.rb index 8f3951447..289748a10 100644 --- a/spec/unit/application/ralsh.rb +++ b/spec/unit/application/ralsh.rb @@ -7,6 +7,8 @@ require 'puppet/application/ralsh' describe "ralsh" do before :each do @ralsh = Puppet::Application[:ralsh] + Puppet::Util::Log.stubs(:newdestination) + Puppet::Util::Log.stubs(:level=) end it "should ask Puppet::Application to not parse Puppet configuration file" do |