0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Helpers for testing Wisper publisher/subscribers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Runtime

~> 2.0
 Project Readme

Wisper::Testing

Build Status

Helpers for testing Wisper publisher/subscribers.

Installation

gem 'wisper-testing'

Usage

Using fake! and 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

Using inline! and inline ensures all events are broadcast using the default broadcaster, meaning any subscribers which are subscribed with async: true will not be called asynchronously, but synchronously.

Wisper::Testing.inline!

Wisper::Testing.inline do
  # ...
end

Restore

Using restore! will turn off fake! and inline! and restore the original configuration.

It is not nessesary to call this if you are using the block variations fake and inline.

Wisper::Testing.restore!

Enabled

Wisper::Testing.enabled? # => true/false

Development

ls **/*.rb | entr -c bundle exec rspec

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.