Class: Webspicy::Tester::Reporter::FileSummary
- Inherits:
-
Webspicy::Tester::Reporter
- Object
- Webspicy::Tester::Reporter
- Webspicy::Tester::Reporter::FileSummary
- Defined in:
- lib/webspicy/tester/reporter/file_summary.rb
Constant Summary
Constants inherited from Webspicy::Tester::Reporter
Instance Attribute Summary collapse
-
#errors_count ⇒ Object
readonly
Returns the value of attribute errors_count.
-
#spec_files_count ⇒ Object
readonly
Returns the value of attribute spec_files_count.
Attributes inherited from Webspicy::Tester::Reporter
Instance Method Summary collapse
- #before_spec_file ⇒ Object
- #clear ⇒ Object
-
#initialize(*args, &bl) ⇒ FileSummary
constructor
A new instance of FileSummary.
- #report ⇒ Object
- #spec_file_error(e) ⇒ Object
Methods inherited from Webspicy::Tester::Reporter
Methods included from Support::Colorize
colorize, colorize_error, colorize_highlight, colorize_section, colorize_success
Constructor Details
#initialize(*args, &bl) ⇒ FileSummary
Returns a new instance of FileSummary.
6 7 8 9 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 6 def initialize(*args, &bl) super clear end |
Instance Attribute Details
#errors_count ⇒ Object (readonly)
Returns the value of attribute errors_count.
10 11 12 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 10 def errors_count @errors_count end |
#spec_files_count ⇒ Object (readonly)
Returns the value of attribute spec_files_count.
10 11 12 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 10 def spec_files_count @spec_files_count end |
Instance Method Details
#before_spec_file ⇒ Object
12 13 14 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 12 def before_spec_file @spec_files_count += 1 end |
#clear ⇒ Object
33 34 35 36 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 33 def clear @spec_files_count = 0 @errors_count = 0 end |
#report ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 20 def report msg = "#{plural('spec file', spec_files_count)}, "\ "#{plural('error', errors_count)}" if success? msg = colorize_success(msg, config) else msg = colorize_error(msg, config) end io.puts(msg) io.puts io.flush end |
#spec_file_error(e) ⇒ Object
16 17 18 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 16 def spec_file_error(e) @errors_count += 1 end |