Permalink
Browse files

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.
  • Loading branch information...
MarkusQ authored and test branch committed Jul 31, 2009
1 parent ba2a3af commit b1b3bcfb5aaace5b6f678b63b02b612cf33a1781
Showing with 5 additions and 1 deletion.
  1. +5 −1 spec/unit/daemon.rb
View
@@ -279,6 +279,11 @@ def without_warnings
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 @@ def without_warnings
@daemon.argv = %w{foo}
@daemon.expects(:stop).with(:exit => false)
- @daemon.stubs(:exec)
@daemon.reexec
end

0 comments on commit b1b3bcf

Please sign in to comment.