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
-
#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 10 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 6 def initialize(*args, &bl) super @spec_files_count = 0 @errors_count = 0 end |
Instance Attribute Details
#errors_count ⇒ Object (readonly)
Returns the value of attribute errors_count.
11 12 13 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 11 def errors_count @errors_count end |
#spec_files_count ⇒ Object (readonly)
Returns the value of attribute spec_files_count.
11 12 13 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 11 def spec_files_count @spec_files_count end |
Instance Method Details
#before_spec_file ⇒ Object
13 14 15 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 13 def before_spec_file @spec_files_count += 1 end |
#report ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 21 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
17 18 19 |
# File 'lib/webspicy/tester/reporter/file_summary.rb', line 17 def spec_file_error(e) @errors_count += 1 end |