Class: AppMap::Minitest::Recording
- Inherits:
-
Struct
- Object
- Struct
- AppMap::Minitest::Recording
- Defined in:
- lib/appmap/minitest.rb
Instance Attribute Summary collapse
-
#test ⇒ Object
Returns the value of attribute test.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(test) ⇒ Recording
constructor
A new instance of Recording.
Constructor Details
Instance Attribute Details
#test ⇒ Object
Returns the value of attribute test
16 17 18 |
# File 'lib/appmap/minitest.rb', line 16 def test @test end |
Instance Method Details
#finish ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/appmap/minitest.rb', line 24 def finish warn "Finishing recording of test #{test.class}.#{test.name}" if AppMap::Minitest::LOG events = [] AppMap.tracing.delete @trace events << @trace.next_event.to_h while @trace.event? AppMap::Minitest.add_event_methods @trace.event_methods class_map = AppMap.class_map(@trace.event_methods) feature_group = test.class.name.underscore.split('_')[0...-1].join('_').capitalize feature_name = test.name.split('_')[1..-1].join(' ') scenario_name = [ feature_group, feature_name ].join(' ') AppMap::Minitest.save scenario_name, class_map, events: events, feature_name: feature_name, feature_group_name: feature_group end |