Class: Assert::View::TestUnitView

Inherits:
Base
  • Object
show all
Defined in:
lib/assert/view/test_unit_view.rb

Overview

this view renders in test/unit style

Direct Known Subclasses

RedgreenView

Instance Attribute Summary

Attributes inherited from Base

#output_io, #runtime_result_callback, #suite

Instance Method Summary collapse

Methods inherited from Base

#all_pass?, #all_pass_result_summary_msg, #all_results_for, #capture_output_end_msg, #capture_output_start_msg, #count, #detailed_results, #handle_runtime_result, #initialize, #ocurring_result_types, #ordered_suite_contexts, #ordered_suite_files, #result_summary_msg, #run_tests, #run_time, #runner_seed, #show_result_details?, #suite_contexts, #suite_files, template, #tests?, #to_sentence, #view

Methods included from Renderer

included, #render

Constructor Details

This class inherits a constructor from Assert::View::Base

Instance Method Details

#finished_statementObject



49
50
51
# File 'lib/assert/view/test_unit_view.rb', line 49

def finished_statement
  "Finished in #{self.run_time} seconds."
end

#loaded_suite_statementObject



41
42
43
# File 'lib/assert/view/test_unit_view.rb', line 41

def loaded_suite_statement
  "Loaded suite #{$0.to_s}"
end

#results_breakdown_statementObject

generate a sentence fragment describing the breakdown of test results if a block is given, yield each msg in the breakdown for custom template formatting



55
56
57
58
59
60
61
# File 'lib/assert/view/test_unit_view.rb', line 55

def results_breakdown_statement
  [ "#{self.count(:tests)} tests, #{self.count(:results)} assertions",
    self.to_sentence(self.ocurring_result_types.collect do |result_type|
      self.result_summary_msg(result_type)
    end)
  ].join(", ")
end

#started_statementObject



45
46
47
# File 'lib/assert/view/test_unit_view.rb', line 45

def started_statement
  "Started"
end