Class: Specdown::TextReporter
- Inherits:
-
Object
- Object
- Specdown::TextReporter
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
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
#print_end ⇒ Object
38
39
40
|
# File 'lib/specdown/reporters/text_reporter.rb', line 38
def print_end
@file.close
end
|
#print_failure(test) ⇒ Object
26
27
28
|
# File 'lib/specdown/reporters/text_reporter.rb', line 26
def print_failure(test)
@file.write "F"
end
|
#print_pending(test) ⇒ Object
30
31
32
|
# File 'lib/specdown/reporters/text_reporter.rb', line 30
def print_pending(test)
@file.write "P"
end
|
#print_readme_end(readme) ⇒ Object
18
19
20
|
# File 'lib/specdown/reporters/text_reporter.rb', line 18
def print_readme_end(readme)
@file.write "\n\n"
end
|
#print_readme_start(readme) ⇒ Object
14
15
16
|
# File 'lib/specdown/reporters/text_reporter.rb', line 14
def print_readme_start(readme)
@file.write(readme.file_name + ": ")
end
|
#print_start ⇒ Object
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
|
#print_success(test) ⇒ Object
22
23
24
|
# File 'lib/specdown/reporters/text_reporter.rb', line 22
def print_success(test)
@file.write "."
end
|
#print_summary(readmes) ⇒ Object
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
|
#print_undefined(test) ⇒ Object
34
35
36
|
# File 'lib/specdown/reporters/text_reporter.rb', line 34
def print_undefined(test)
@file.write "U"
end
|