Skip to content

Commit

Permalink
catch errors in tests blocks and keep going
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed May 22, 2010
1 parent 81dac9c commit d970d77
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/shindo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ def tests(description, tags = [], &block)
if (@if_tagged.empty? || !(@if_tagged & @tag_stack.flatten).empty?) &&
(@unless_tagged.empty? || (@unless_tagged & @tag_stack.flatten).empty?)
if block_given?
@formatador.display_line(description)
@formatador.indent { instance_eval(&block) }
begin
@formatador.display_line(description)
@formatador.indent { instance_eval(&block) }
rescue => error
@formatador.display_line("[red]#{error.message} (#{error.class})[/]")
end
else
@description = description
end
Expand Down

0 comments on commit d970d77

Please sign in to comment.