Sha256: d1f0c53655533f312c04cce83ed738416b8f11e4095d69a7a7c778a0e18ebf77

Contents?: true

Size: 918 Bytes

Versions: 27

Compression:

Stored size: 918 Bytes

Contents

require 'spec_helper'

begin
  require 'sinatra'
rescue LoadError
end

if defined?(::Sinatra)
  ENV['APPSIGNAL_PUSH_API_KEY'] = 'key'
  require 'appsignal/integrations/sinatra'

  describe "Sinatra integration" do
    context "logger" do
      subject { Appsignal.logger }

      it { should be_a Logger }
    end

    context "config" do
      subject { Appsignal.config }

      it { should be_a(Appsignal::Config) }
    end

    context "agent" do
      subject { Appsignal.agent }

      it { should be_a(Appsignal::Agent) }
    end

    it "should have added the listener middleware" do
      Sinatra::Application.middleware.to_a.should include(
        [Appsignal::Rack::Listener, [], nil]
      )
    end

    it "should have added the instrumentation middleware" do
      Sinatra::Application.middleware.to_a.should include(
        [Appsignal::Rack::SinatraInstrumentation, [], nil]
      )
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
appsignal-0.11.18 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.17 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.16 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.15 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.14 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.14.beta.1 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.13 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.13.beta.4 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.13.beta.3 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.13.beta.2 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.13.beta.1 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.13.beta.0 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.12 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.11 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.10 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.10.beta.2 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.10.beta.1 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.9 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.8.beta.4 spec/lib/appsignal/integrations/sinatra_spec.rb
appsignal-0.11.8.beta.3 spec/lib/appsignal/integrations/sinatra_spec.rb