Skip to content

Commit

Permalink
Handler is required to be an explicit instance now
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszreszke committed Feb 8, 2023
1 parent c54dd14 commit cab0cff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module RSpec
)
)
end
let(:handler) { Handler }
let(:handler) { Handler.new }

def matcher(*expected)
HaveSubscribedToEvents.new(*expected, differ: colorless_differ, phraser: phraser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ module RSpec
specify { expect(matchers.have_subscribed_to_events(FooEvent, BarEvent)).to be_an(HaveSubscribedToEvents) }

specify do
event_store.subscribe(Handler, to: [FooEvent])
expect(Handler).to matchers.have_subscribed_to_events(FooEvent).in(event_store)
expect(Handler).not_to matchers.have_subscribed_to_events(BarEvent).in(event_store)
handler = Handler.new
event_store.subscribe(handler, to: [FooEvent])
expect(handler).to matchers.have_subscribed_to_events(FooEvent).in(event_store)
expect(handler).not_to matchers.have_subscribed_to_events(BarEvent).in(event_store)
end
end

Expand Down

0 comments on commit cab0cff

Please sign in to comment.