123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::EventReporter::TestHelper

Do not use. This module is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Defined in: activesupport/lib/active_support/event_reporter/test_helper.rb

Instance Method Summary

Instance Method Details

#event_matcher(name:, payload: nil, tags: {}, context: {}, source_location: nil)

[ GitHub ]

  
# File 'activesupport/lib/active_support/event_reporter/test_helper.rb', line 16

def event_matcher(name:, payload: nil, tags: {}, context: {}, source_location: nil)
  ->(event) {
    return false unless event[:name] == name
    return false unless event[:payload] == payload
    return false unless event[:tags] == tags
    return false unless event[:context] == context

    [:filepath, :lineno, :label].each do |key|
      if source_location && source_location[key]
        return false unless event[:source_location][key] == source_location[key]
      end
    end

    true
  }
end