Permalink
Browse files

Make before/after :all messages a bit more clear.

  • Loading branch information...
alloy committed May 19, 2010
1 parent b422142 commit 10034b6721837d3aead6dd6190112ecaf80230b5
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/bacon.rb
View
@@ -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
@@ -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)

0 comments on commit 10034b6

Please sign in to comment.