Helpers for testing Wisper publisher/subscribers.
fake prevents any events from being broadcast.
Instead each event is recorded and can be inspected.
Wisper::Testing.fake! Wisper::Testing.fake do # ... end Wisper::Testing.events # => [...]
inline ensures all events are broadcast using the default
broadcaster, meaning any subscribers which are subscribed with
will not be called asynchronously, but synchronously.
Wisper::Testing.inline! Wisper::Testing.inline do # ... end
restore! will turn off
inline! and restore the original
It is not nessesary to call this if you are using the block variations
Wisper::Testing.enabled? # => true/false
ls **/*.rb | entr -c bundle exec rspec
Bug reports and pull requests are welcome on GitHub at https://github.com/krisleech/wisper-testing.
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.