Class: TestProf::RubyProf::Listener
- Inherits:
-
Object
- Object
- TestProf::RubyProf::Listener
- Defined in:
- lib/test_prof/ruby_prof/rspec.rb
Overview
Reporter for RSpec to profile specific examples with RubyProf
Constant Summary collapse
- NOTIFICATIONS =
%i[ example_started example_finished ].freeze
Class Attribute Summary collapse
-
.report_name_generator ⇒ Object
Returns the value of attribute report_name_generator.
Instance Method Summary collapse
Class Attribute Details
permalink .report_name_generator ⇒ Object
Returns the value of attribute report_name_generator.
10 11 12 |
# File 'lib/test_prof/ruby_prof/rspec.rb', line 10 def report_name_generator @report_name_generator end |
Instance Method Details
permalink #example_finished(notification) ⇒ Object
[View source]
26 27 28 29 30 31 |
# File 'lib/test_prof/ruby_prof/rspec.rb', line 26 def example_finished(notification) return unless profile?(notification.example) notification.example.[:rprof_report]&.dump( self.class.report_name_generator.call(notification.example) ) end |
permalink #example_started(notification) ⇒ Object
[View source]
20 21 22 23 24 |
# File 'lib/test_prof/ruby_prof/rspec.rb', line 20 def example_started(notification) return unless profile?(notification.example) notification.example.[:rprof_report] = TestProf::RubyProf.profile end |