Class: Rectify::RSpec::DatabaseReporter::Reporter
- Inherits:
-
Object
- Object
- Rectify::RSpec::DatabaseReporter::Reporter
- Defined in:
- lib/rectify/rspec/database_reporter/reporter.rb
Instance Method Summary collapse
- #example_started(notification) ⇒ Object
-
#initialize ⇒ Reporter
constructor
A new instance of Reporter.
- #start(_) ⇒ Object
- #start_dump(_) ⇒ Object
Constructor Details
#initialize ⇒ Reporter
Returns a new instance of Reporter.
34 35 36 |
# File 'lib/rectify/rspec/database_reporter/reporter.rb', line 34 def initialize @query_stats = QueryStats.new end |
Instance Method Details
#example_started(notification) ⇒ Object
45 46 47 |
# File 'lib/rectify/rspec/database_reporter/reporter.rb', line 45 def example_started(notification) @current_example = notification.example end |
#start(_) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/rectify/rspec/database_reporter/reporter.rb', line 38 def start(_) ActiveSupport::Notifications .subscribe("sql.active_record") do |_, start, finish, _, query| query_stats.add(current_example, start, finish, query) end end |