forked from railslove/rack-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler_set_spec.rb
More file actions
32 lines (25 loc) · 763 Bytes
/
handler_set_spec.rb
File metadata and controls
32 lines (25 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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