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-0.4.2 spec/tracker/handler_set_spec.rb
rack-tracker-0.4.1 spec/tracker/handler_set_spec.rb
rack-tracker-0.4.0 spec/tracker/handler_set_spec.rb
rack-tracker-0.3.0 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.6 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.5 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.4 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.3 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.2 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.1 spec/tracker/handler_set_spec.rb
rack-tracker-0.2.0 spec/tracker/handler_set_spec.rb
rack-tracker-0.1.3 spec/tracker/handler_set_spec.rb
rack-tracker-0.1.1 spec/tracker/handler_set_spec.rb
rack-tracker-0.1.0 spec/tracker/handler_set_spec.rb
rack-tracker-0.0.4 spec/tracker/handler_set_spec.rb
rack-tracker-0.0.3 spec/tracker/handler_set_spec.rb
rack-tracker-0.0.2 spec/tracker/handler_set_spec.rb