Permalink
Browse files

continuing to improve shindont formatting

  • Loading branch information...
1 parent 00413c3 commit 8fd31426301995473227813a328deaf5c82b5623 @geemus committed Nov 16, 2010
Showing with 13 additions and 14 deletions.
  1. +1 −1 lib/shindo/bin.rb
  2. +12 −13 lib/shindo/taciturn.rb
View
@@ -45,11 +45,11 @@ def run_in_thread(helpers, tests, thread_locals)
end
for file in helpers
unless Thread.main[:exit]
- Thread.current[:file] = file
load(file)
end
end
for file in tests
+ Thread.current[:file] = file
unless Thread.main[:exit]
load(file)
end
View
@@ -3,38 +3,37 @@ class Tests
private
- def display_description_stack(description_stack = @description_stack, formatador = Formatador.new)
- return if description_stack.empty?
- formatador.indent do
- formatador.display_line(description_stack.pop)
- display_description_stack(description_stack, formatador)
+ def display_description_stack
+ return if @description_stack.empty?
+ Thread.current[:formatador].indent do
+ Thread.current[:formatador].display_line(@description_stack.pop)
+ display_description_stack
end
end
def display_description(description)
unless @described
- Thread.current[:formatador].display(description)
+ Thread.current[:formatador].display(Thread.current[:file])
print ' '
@described = true
end
end
def display_error(error)
- Thread.current[:formatador].display_line
- Thread.current[:formatador].display_line(Thread.current[:file])
display_description_stack
- Thread.current[:formatador].display_line("[red]#{error.message} (#{error.class})[/]")
- unless error.backtrace.empty?
- Thread.current[:formatador].indent do
- Thread.current[:formatador].display_lines(error.backtrace.map {|line| "[red]#{line}[/]"})
+ Thread.current[:formatador].indent do
+ Thread.current[:formatador].display_line("[red]#{error.message} (#{error.class})[/]")
+ unless error.backtrace.empty?
+ Thread.current[:formatador].indent do
+ Thread.current[:formatador].display_lines(error.backtrace.map {|line| "[red]#{line}[/]"})
+ end
end
end
end
def display_failure(description)
Thread.current[:totals][:failed] += 1
Thread.current[:formatador].display_line
- Thread.current[:formatador].display_line(Thread.current[:file])
display_description_stack
Thread.current[:formatador].display_line("[red]- #{description}[/]")
end

0 comments on commit 8fd3142

Please sign in to comment.