spec/lib/adapters/rabbitmq/events_spec.rb in basquiat-1.2.0 vs spec/lib/adapters/rabbitmq/events_spec.rb in basquiat-1.3.0.pre.1

- old
+ new

@@ -16,12 +16,19 @@ end end context 'wildcard keys' do let(:proc) { -> { 'Hello from the lambda! o/' } } + describe '*' do let(:words) { %w(awesome lame dumb cool) } + + it 'event.* does not match event_some_word' do + events['event.*'] = proc + expect { events['event_some_word'] }.to raise_error KeyError + end + context 'matches any ONE word' do it 'at the end' do events['some.event.*'] = proc words.each do |word| expect(events["some.event.#{word}"]).to eq proc @@ -68,10 +75,10 @@ it 'matches specific events' do events['#.event'] = proc %w(some.cool.event cool.event).each do |event| expect(events[event]).to eq(proc) end - expect { events['event']}.to raise_error KeyError + expect { events['event'] }.to raise_error KeyError end end end end end