Sha256: be1accc18a948b2f80c753ffa79400cb38d3953b22a265f750d373838f4b86a1

Contents?: true

Size: 785 Bytes

Versions: 23

Compression:

Stored size: 785 Bytes

Contents

require 'spec_helper'

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

23 entries across 23 versions & 1 rubygems

Version Path
appsignal-1.4.0.alpha.2 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.4.0.alpha.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.2 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.0 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.0.beta.3 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.0.beta.2 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.3.0.beta.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.5 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.4 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.4.beta.4 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.4.beta.3 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.4.beta.2 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.4.beta.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.3 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.3.beta.3 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.3.beta.2 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.3.beta.1 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.2 spec/lib/appsignal/hooks/sequel_spec.rb
appsignal-1.2.1 spec/lib/appsignal/hooks/sequel_spec.rb