Sha256: d9c3469191b6b78cca46a21fe6197db5447c90be661c375e1922a6a428942e44

Contents?: true

Size: 1.34 KB

Versions: 6

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe Appsignal do
  it { should respond_to :subscriber }

  describe ".transactions" do
    subject { Appsignal.transactions }

    it { should be_a Hash }
  end

  describe '.agent' do
    subject { Appsignal.agent }

    it { should be_a Appsignal::Agent }
  end

  describe '.logger' do
    subject { Appsignal.logger }

    it { should be_a Logger }
    its(:level) { should == Logger::INFO }
  end

  describe '.config' do
    subject { Appsignal.config }

    it 'should return the endpoint' do
      subject[:endpoint].should eq 'http://localhost:3000/1'
    end

    it 'should return the api key' do
      subject[:api_key].should eq 'abc'
    end

    it 'should return ignored exceptions' do
      subject[:ignore_exceptions].should eq []
    end

    it 'should return the slow request threshold' do
      subject[:slow_request_threshold].should eq 200
    end
  end

  describe '.active?' do
    subject { Appsignal.active? }

    context "without config" do
      before { Appsignal.stub(:config => nil) }

      it { should be_false }
    end

    context "with config but inactive" do
      before { Appsignal.stub(:config => {:active => false}) }

      it { should be_false }
    end

    context "with active config" do
      before { Appsignal.stub(:config => {:active => true}) }

      it { should be_true }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appsignal-0.4.7 spec/appsignal_spec.rb
appsignal-0.4.6 spec/appsignal_spec.rb
appsignal-0.4.5 spec/appsignal_spec.rb
appsignal-0.4.4 spec/appsignal_spec.rb
appsignal-0.4.3 spec/appsignal_spec.rb
appsignal-0.4.0 spec/appsignal_spec.rb