Sha256: 1c5caa7eb5e3330efc33febfdbc07acc3ba8ae4b89895348f5beeff4178848d7

Contents?: true

Size: 1.53 KB

Versions: 18

Compression:

Stored size: 1.53 KB

Contents

require_relative "active_support_notifications/instrument_shared_examples"

describe Appsignal::Hooks::ActiveSupportNotificationsHook do
  if active_support_present?
    let(:notifier) { ActiveSupport::Notifications::Fanout.new }
    let(:as) { ActiveSupport::Notifications }
    let(:transaction) { http_request_transaction }
    before do
      start_agent
      set_current_transaction(transaction)
      as.notifier = notifier
    end
    around { |example| keep_transactions { example.run } }

    describe "#dependencies_present?" do
      subject { described_class.new.dependencies_present? }

      it { is_expected.to be_truthy }
    end

    it_behaves_like "activesupport instrument override"

    if defined?(::ActiveSupport::Notifications::Fanout::Handle)
      require_relative "active_support_notifications/start_finish_shared_examples"

      it_behaves_like "activesupport start finish override"
    end

    if ::ActiveSupport::Notifications::Instrumenter.method_defined?(:start)
      require_relative "active_support_notifications/start_finish_shared_examples"

      it_behaves_like "activesupport start finish override"
    end

    if ::ActiveSupport::Notifications::Instrumenter.method_defined?(:finish_with_state)
      require_relative "active_support_notifications/finish_with_state_shared_examples"

      it_behaves_like "activesupport finish_with_state override"
    end
  else
    describe "#dependencies_present?" do
      subject { described_class.new.dependencies_present? }

      it { is_expected.to be_falsy }
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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