Skip to content

Commit

Permalink
adding the ability to capture the output of a report to a string
Browse files Browse the repository at this point in the history
  • Loading branch information
wbailey committed Feb 21, 2012
1 parent 661a9b3 commit 7b10468
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/variable.rb
@@ -0,0 +1,29 @@
require 'command_line_reporter'

include CommandLineReporter

class Example
def initialize
self.formatter = 'progress'
end

def run
suppress_output
report do
sum = 0
10.times do
sum += 10
progress
end
vertical_spacing
aligned("Sum: #{sum}")
end

out = capture_output

puts 'here'
puts out
end
end

Example.new.run

0 comments on commit 7b10468

Please sign in to comment.