Sha256: a930bf5136d9081bb11f41b2eea8364c5abe9bcc7ddf5122014867d94f4dcbf9

Contents?: true

Size: 877 Bytes

Versions: 12

Compression:

Stored size: 877 Bytes

Contents

require 'spec_helper'
module Queuel
  describe Configurator do
    describe "configuration" do
      before do
        subject.credentials username: "jon"
      end

      it "set the logger" do
        subject.logger.should be_a Logger
        subject.log_level.should == MonoLogger::ERROR
      end

      describe "configured logger" do
        let(:some_other_logger) { double "logger" }

        it "fails on a logger without the correct methods" do
          expect { subject.logger some_other_logger }.to raise_error Configurator::InvalidConfigurationError,
            "Logger must respond to #{%w[info warn debug level level]}"
        end
      end

      it "set the credentials" do
        subject.credentials.should == { username: "jon" }
      end

      it "has a default worker count" do
        subject.receiver_threads.should == 1
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
queuel-0.4.8 spec/lib/queuel/configurator_spec.rb
queuel-0.4.6 spec/lib/queuel/configurator_spec.rb
queuel-0.4.5 spec/lib/queuel/configurator_spec.rb
queuel-0.4.4 spec/lib/queuel/configurator_spec.rb
queuel-0.4.3 spec/lib/queuel/configurator_spec.rb
queuel-0.4.2 spec/lib/queuel/configurator_spec.rb
queuel-0.4.1 spec/lib/queuel/configurator_spec.rb
queuel-0.4.0 spec/lib/queuel/configurator_spec.rb
queuel-0.3.1 spec/lib/queuel/configurator_spec.rb
queuel-0.3.0 spec/lib/queuel/configurator_spec.rb
queuel-0.2.0 spec/lib/queuel/configurator_spec.rb
queuel-0.1.0 spec/lib/queuel/configurator_spec.rb