Class: Baleen::ResultDisplay
- Inherits:
-
Object
- Object
- Baleen::ResultDisplay
- Defined in:
- lib/baleen/result_display.rb
Instance Method Summary collapse
- #detail ⇒ Object
-
#initialize(result, start_time, end_time, output = $stdout) ⇒ ResultDisplay
constructor
A new instance of ResultDisplay.
- #report_result ⇒ Object
- #summary ⇒ Object
Constructor Details
#initialize(result, start_time, end_time, output = $stdout) ⇒ ResultDisplay
Returns a new instance of ResultDisplay.
5 6 7 8 9 10 |
# File 'lib/baleen/result_display.rb', line 5 def initialize(result, start_time, end_time, output=$stdout) @result = result @start_time = start_time @end_time = end_time @output = output end |
Instance Method Details
#detail ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/baleen/result_display.rb', line 30 def detail @output.puts "[Details]".yellow @result.each do |r| @output.puts "Id: ".yellow + "#{r['container_id']}".green @output.puts "status code: ".yellow + "#{r['status_code']}".green @output.puts "feature file: ".yellow + "#{r['file']}".green if r['stdout'] @output.puts "STDOUT:".yellow @output.puts "------------------------------------".yellow @output.puts "#{r['stdout'].join}".green end if r['stderr'] @output.puts "STDERR:".yellow @output.puts "------------------------------------".yellow @output.puts "#{r['stderr'].join}".red end end end |
#report_result ⇒ Object
12 13 14 15 16 17 |
# File 'lib/baleen/result_display.rb', line 12 def report_result if @result summary detail end end |
#summary ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/baleen/result_display.rb', line 19 def summary tests_result = pass_all? ? "Pass".blue : "Fail".red time = run_time @output.puts "" @output.puts "[Summary]".yellow @output.puts "Result: ".yellow + tests_result @output.puts "Time: ".yellow + time.green @output.puts "" end |