Class: Minitest::TestDotsReporter
- Inherits:
-
AbstractReporter
- Object
- AbstractReporter
- Minitest::TestDotsReporter
- Defined in:
- lib/minitest/test_dots_plugin.rb
Instance Method Summary collapse
-
#initialize ⇒ TestDotsReporter
constructor
A new instance of TestDotsReporter.
- #record(result) ⇒ Object
- #report ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ TestDotsReporter
Returns a new instance of TestDotsReporter.
12 13 14 15 16 |
# File 'lib/minitest/test_dots_plugin.rb', line 12 def initialize @dir = Pathname.new(Dir.pwd) @results = [] @start_time = nil end |
Instance Method Details
#record(result) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/minitest/test_dots_plugin.rb', line 22 def record(result) status = if result.passed? 'passed' elsif result.skipped? 'skipped' else 'failed' end @results << { description: result.name, full_description: "#{result.class}##{result.name}", location: location_for_result(result), run_time: result.time, status: status } end |
#report ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/minitest/test_dots_plugin.rb', line 40 def report run_time = Minitest.clock_time - @start_time TestDots.send_report( framework: 'minitest', run_time: run_time, results: @results ) end |
#start ⇒ Object
18 19 20 |
# File 'lib/minitest/test_dots_plugin.rb', line 18 def start @start_time = Minitest.clock_time end |