Sha256: 6d547813799e4ed8e135bde68ea0a56c71a5ee876a1b3c6cc452f27a4f8433a9

Contents?: true

Size: 892 Bytes

Versions: 5

Compression:

Stored size: 892 Bytes

Contents

require 'spec_helper'

describe Appsignal::Config do
  subject { Appsignal::Config.new(Dir.pwd, 'test').load }

  it {
    should == {
      :ignore_exceptions => [],
      :endpoint => 'http://localhost:3000/1',
      :slow_request_threshold => 200,
      :api_key => 'abc',
      :active => true
    }
  }

  context 'when there is no config file' do
    before { Dir.stub(:pwd => '/not/existing') }

    it "should log error" do
      Appsignal.logger.should_receive(:error).with(
        "config not found at:"\
        " /not/existing/config/appsignal.yml"
      )
    end

    after { subject }
  end

  context "the env is not in the config" do
    subject { Appsignal::Config.new(Dir.pwd, 'staging').load }

    it "should generate error" do
      Appsignal.logger.should_receive(:error).with(
        "config for 'staging' not found"
      )
    end

    after { subject }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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