Skip to content

Commit

Permalink
Make before/after :all messages a bit more clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed May 19, 2010
1 parent b422142 commit 10034b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/bacon.rb
Expand Up @@ -143,7 +143,9 @@ def run
return unless name =~ RestrictContext
Counter[:context_depth] += 1
Bacon.handle_specification(name) { instance_eval(&block) }
catch_errors("after :all") { @after_all.each { |block| instance_eval(&block) } }
catch_errors("in after(:all) block") do
@after_all.each { |block| instance_eval(&block) }
end
Counter[:context_depth] -= 1
self
end
Expand All @@ -152,7 +154,7 @@ def before(at = :each, &block)
if at == :each
@before << block
else
catch_errors("before :all") do
catch_errors("in before(:all) block") do
before = instance_variables
instance_eval(&block)
@before_all_ivars.concat(instance_variables - before)
Expand Down

0 comments on commit 10034b6

Please sign in to comment.