summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-07-31 15:26:37 -0400
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitb1b3bcfb5aaace5b6f678b63b02b612cf33a1781 (patch)
tree97815494eb2db7f402e061091e7282a80e5d6228
parentba2a3afb45199e3b85db03a1bb54a925bffce08f (diff)
Resolving conflicts with testing
Jesse writes: ethanrowe:tickets/master/2239 leaks state in the spec. After the spec is run, Puppet::Application is left in a :restart_requested state, and several important behaviors, particularly Puppet::Transaction#evaluate are disabled. It's order dependent, so changing the mtime of spec files makes the failures appear and disappear. This spec file was generally pretty good about keeping state from getting out, but one test was missing a stub for a dangerous call. I wouldn't be surprised if this cleared up other errors in testing.
-rwxr-xr-xspec/unit/daemon.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/daemon.rb b/spec/unit/daemon.rb
index 1bf8f5692..e163f4067 100755
--- a/spec/unit/daemon.rb
+++ b/spec/unit/daemon.rb
@@ -279,6 +279,11 @@ describe Puppet::Daemon do
end
describe "when reexecing it self" do
+ before do
+ @daemon.stubs(:exec)
+ @daemon.stubs(:stop)
+ end
+
it "should fail if no argv values are available" do
@daemon.expects(:argv).returns nil
lambda { @daemon.reexec }.should raise_error(Puppet::DevError)
@@ -288,7 +293,6 @@ describe Puppet::Daemon do
@daemon.argv = %w{foo}
@daemon.expects(:stop).with(:exit => false)
- @daemon.stubs(:exec)
@daemon.reexec
end