Sha256: 7b420cf331ccd9db7833aef22ec2ad2693fd7c0b2c567de632e5492fbf2d84d6

Contents?: true

Size: 762 Bytes

Versions: 6

Compression:

Stored size: 762 Bytes

Contents

describe Appsignal::Hooks::SequelHook, if: sequel_present? do
  let(:db) { Sequel.sqlite }

  before :all do
    start_agent
  end

  its(:dependencies_present?) { should be_true }

  context "with a transaction" do
    it "should instrument queries" do
      Appsignal::Transaction.create('uuid', Appsignal::Transaction::HTTP_REQUEST, 'test')
      expect( Appsignal::Transaction.current ).to receive(:start_event)
        .at_least(:once)
      expect( Appsignal::Transaction.current ).to receive(:finish_event)
        .at_least(:once)
        .with("sql.sequel", nil, kind_of(String), 1)

      db['SELECT 1'].all.to_a
    end
  end
end

describe Appsignal::Hooks::SequelHook, unless: sequel_present? do
  its(:dependencies_present?) { should be_false }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appsignal-1.3.6 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.6.beta.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.5 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.5.beta.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.4 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.3 spec/lib/appsignal/hooks/sequel_spec.rb