Sha256: 885c01d7491b6b3b761b1310b083ee401376bd839d9928ed5f7614c51df222c4

Contents?: true

Size: 763 Bytes

Versions: 37

Compression:

Stored size: 763 Bytes

Contents

class Dummy < Rack::Tracker::Handler
end

RSpec.describe Rack::Tracker::HandlerSet do

  let(:set) do
    Rack::Tracker::HandlerSet.new do
      handler 'dummy', {foo: "bar"}
    end
  end

  describe '#each' do
    subject { set.each }
    specify { expect(subject.to_a.size).to eq(1) }
    specify { expect(subject).to match_array(Dummy) }
  end

  describe Rack::Tracker::HandlerSet::Handler do
    subject { described_class.new(Dummy, {foo: 'bar'}) }

    describe '#init' do
      it 'will initialize the handler with the given class' do
        expect(subject.init({})).to be_kind_of(Dummy)
      end

      it 'will initialize the handler with the given options' do
        expect(subject.init({}).options).to eq({foo: 'bar'})
      end
    end
  end

end

Version data entries

37 entries across 37 versions & 1 rubygems

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