Class: Dotpretty::Reporters::Progress
- Inherits:
-
Object
- Object
- Dotpretty::Reporters::Progress
- Defined in:
- lib/dotpretty/reporters/progress.rb
Instance Method Summary collapse
- #build_completed ⇒ Object
- #build_failed(failure_details) ⇒ Object
- #build_failed_to_start(raw_input_inlines) ⇒ Object
- #build_started ⇒ Object
-
#initialize(color_palette:, output:) ⇒ Progress
constructor
A new instance of Progress.
- #show_test_summary(summary) ⇒ Object
- #starting_tests ⇒ Object
- #test_failed(name:, details:) ⇒ Object
- #test_passed(name:) ⇒ Object
- #test_skipped(name:) ⇒ Object
Constructor Details
#initialize(color_palette:, output:) ⇒ Progress
Returns a new instance of Progress.
5 6 7 8 9 10 11 |
# File 'lib/dotpretty/reporters/progress.rb', line 5 def initialize(color_palette:, output:) self.color_palette = color_palette self.extend(color_palette) self.failing_tests = [] self.skipped_test_names = [] self.output = output end |
Instance Method Details
#build_completed ⇒ Object
13 14 15 16 |
# File 'lib/dotpretty/reporters/progress.rb', line 13 def build_completed output.puts("Build completed") output.puts("") end |
#build_failed(failure_details) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/dotpretty/reporters/progress.rb', line 28 def build_failed(failure_details) output.puts("Build failed") failure_details.each do |detail| output.puts(detail) end end |
#build_failed_to_start(raw_input_inlines) ⇒ Object
18 19 20 21 22 |
# File 'lib/dotpretty/reporters/progress.rb', line 18 def build_failed_to_start(raw_input_inlines) raw_input_inlines.each do |raw_input_line| output.puts(raw_input_line) end end |
#build_started ⇒ Object
24 25 26 |
# File 'lib/dotpretty/reporters/progress.rb', line 24 def build_started output.puts("Build started") end |
#show_test_summary(summary) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/dotpretty/reporters/progress.rb', line 35 def show_test_summary(summary) output.puts("") output.puts("") show_skipped_summary if !skipped_test_names.empty? show_failure_summary if !failing_tests.empty? output.puts(formatted_test_summary(summary)) end |
#starting_tests ⇒ Object
43 44 45 |
# File 'lib/dotpretty/reporters/progress.rb', line 43 def starting_tests output.puts("Starting test execution") end |
#test_failed(name:, details:) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/dotpretty/reporters/progress.rb', line 47 def test_failed(name:, details:) failing_tests << { details: details, name: name } output.print(red("F")) end |
#test_passed(name:) ⇒ Object
55 56 57 |
# File 'lib/dotpretty/reporters/progress.rb', line 55 def test_passed(name:) output.print(green(".")) end |
#test_skipped(name:) ⇒ Object
59 60 61 62 |
# File 'lib/dotpretty/reporters/progress.rb', line 59 def test_skipped(name:) skipped_test_names << name output.print(yellow("*")) end |