Class: Specdown::TextReporter

Inherits:
Object
  • Object
show all
Includes:
Reporter
Defined in:
lib/specdown/reporters/text_reporter.rb

Instance Method Summary collapse

Methods included from Reporter

#print_readme_summary, #print_test_end, #print_test_start, #summary

Constructor Details

#initializeTextReporter

Returns a new instance of TextReporter.



5
6
7
# File 'lib/specdown/reporters/text_reporter.rb', line 5

def initialize
  @file = File.new "specdown_report.txt", "w"
end

Instance Method Details



38
39
40
# File 'lib/specdown/reporters/text_reporter.rb', line 38

def print_end
  @file.close
end


26
27
28
# File 'lib/specdown/reporters/text_reporter.rb', line 26

def print_failure(test)
  @file.write "F"
end


30
31
32
# File 'lib/specdown/reporters/text_reporter.rb', line 30

def print_pending(test)
  @file.write "P"
end


18
19
20
# File 'lib/specdown/reporters/text_reporter.rb', line 18

def print_readme_end(readme)
  @file.write "\n\n" 
end


14
15
16
# File 'lib/specdown/reporters/text_reporter.rb', line 14

def print_readme_start(readme)
  @file.write(readme.file_name + ": ")
end


9
10
11
12
# File 'lib/specdown/reporters/text_reporter.rb', line 9

def print_start
  @file.write Time.now.to_s
  @file.write "\n\n"
end


22
23
24
# File 'lib/specdown/reporters/text_reporter.rb', line 22

def print_success(test) 
  @file.write "."
end


42
43
44
45
46
# File 'lib/specdown/reporters/text_reporter.rb', line 42

def print_summary(readmes)
  @report_summary = summary(readmes)
  bounding = binding rescue proc {}
  @file.write template.result(bounding)
end


34
35
36
# File 'lib/specdown/reporters/text_reporter.rb', line 34

def print_undefined(test)
  @file.write "U"
end