Sha256: 64012c5ce736e8b6c22a09b0c1d26c4a4c34653234b970d86128e9db751c0acf

Contents?: true

Size: 1.32 KB

Versions: 156

Compression:

Stored size: 1.32 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) do
      Appsignal::Transaction.create("uuid", Appsignal::Transaction::HTTP_REQUEST, "test")
    end
    before :context do
      start_agent
    end
    before do
      as.notifier = notifier
    end

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

      it { is_expected.to be_truthy }
    end

    it_behaves_like "activesupport instrument override"

    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

156 entries across 156 versions & 1 rubygems

Version Path
appsignal-3.4.3-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.3 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.2-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.2 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.1-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.1 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.0-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.4.0 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.10-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.10 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.9-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.9 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.8-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.8 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.7-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.7 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.6-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.6 spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.5-java spec/lib/appsignal/hooks/active_support_notifications_spec.rb
appsignal-3.3.5 spec/lib/appsignal/hooks/active_support_notifications_spec.rb