Sha256: fcce9fefec3cd28828e4f33f9accc394580363087206fb42b6a946f25898232d

Contents?: true

Size: 857 Bytes

Versions: 44

Compression:

Stored size: 857 Bytes

Contents

shared_examples "activesupport finish_with_state override" do
  let(:instrumenter) { as.instrumenter }

  it "instruments an ActiveSupport::Notifications.start/finish event with payload on finish" do
    listeners_state = instrumenter.start("sql.active_record", {})
    instrumenter.finish_with_state(listeners_state, "sql.active_record", :sql => "SQL")

    expect(transaction).to include_event(
      "body" => "SQL",
      "body_format" => Appsignal::EventFormatter::SQL_BODY_FORMAT,
      "count" => 1,
      "name" => "sql.active_record",
      "title" => ""
    )
  end

  it "does not instrument events whose name starts with a bang" do
    listeners_state = instrumenter.start("!sql.active_record", {})
    instrumenter.finish_with_state(listeners_state, "!sql.active_record", :sql => "SQL")

    expect(transaction).to_not include_events
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
appsignal-4.0.6-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.6 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.5-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.5 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.4-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.4 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.3-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.3 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.2-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.2 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.1-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.1 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.0-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.0 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-3.13.1-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-3.13.1 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-3.13.1.alpha.1-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-3.13.1.alpha.1 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.0.beta.2-java spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb
appsignal-4.0.0.beta.2 spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb