Sha256: 5cd1da66fdbbca19b913ebdd8c5234604d2823638cbf351190f6be95c608680c

Contents?: true

Size: 673 Bytes

Versions: 37

Compression:

Stored size: 673 Bytes

Contents

Foo = Class.new
Bar = Class.new

RSpec.describe Rack::Tracker::HandlerDelegator do

  describe '#handler' do

    it 'will find handler in the Rack::Tracker namespace' do
      expect(described_class.handler(:google_analytics)).to eq(Rack::Tracker::GoogleAnalytics)
    end

    it 'will find handler outside the Rack::Tracker namespace' do
      expect(described_class.handler(:foo)).to eq(Foo)
    end

    it 'will just return a class' do
      expect(described_class.handler(Bar)).to eq(Bar)
    end

    it 'will raise when no handler is found' do
      expect { described_class.handler(:baz)}.to raise_error(ArgumentError, "No such Handler: Baz")
    end

  end

end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
rack-tracker-1.13.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.12.1 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.12.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.11.2 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.11.1 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.11.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.10.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.9.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.8.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.7.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.6.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.5.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.4.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.3.1 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.3.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.2.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.1.0 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.0.2 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.0.1 spec/tracker/handler_delegator_spec.rb
rack-tracker-1.0.0 spec/tracker/handler_delegator_spec.rb