Sha256: 42e8ab80dd63c8b10fc589380e7097a1a18143c95c400aaf3d2c500a53092b32

Contents?: true

Size: 953 Bytes

Versions: 120

Compression:

Stored size: 953 Bytes

Contents

describe Appsignal::Hooks::DataMapperHook do
  context "with datamapper" do
    before :context do
      module DataMapper
      end

      module DataObjects
        class Connection
        end
      end
      Appsignal::Hooks::DataMapperHook.new.install
    end

    after :context do
      Object.send(:remove_const, :DataMapper)
      Object.send(:remove_const, :DataObjects)
    end

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

      it { is_expected.to be_truthy }
    end

    it "should install the listener" do
      expect(::DataObjects::Connection).to receive(:include)
        .with(Appsignal::Hooks::DataMapperLogListener)

      Appsignal::Hooks::DataMapperHook.new.install
    end
  end

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

      it { is_expected.to be_falsy }
    end
  end
end

Version data entries

120 entries across 120 versions & 1 rubygems

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