Permalink
Browse files

turn off nesting indicator after block is done

  • Loading branch information...
1 parent b5e4254 commit 2f4455175ec0f0aa825f06924c07204820b273da @bronson committed Mar 26, 2011
Showing with 4 additions and 0 deletions.
  1. +2 −0 lib/retryable.rb
  2. +2 −0 spec/retryable_spec.rb
View
@@ -44,6 +44,8 @@ def retryable options = {}, &block
sleep opts[:sleep].respond_to?(:call) ? opts[:sleep].call(retries) : opts[:sleep]
retries += 1
retry
+ ensure
+ @retryable_nest = nil
end
end
end
View
@@ -169,6 +169,8 @@ def count_retryable *opts
should_raise(NestingError) {
retryable { retryable { raise "not reached" } }
}
+ # make sure that the nesting flag is turned off
+ retryable { 'foo' }.should == 'foo'
end
it "detects nesting even if inner loop refuses" do

0 comments on commit 2f44551

Please sign in to comment.