wisper-spectator
Handy Wisper.cr test helpers for the Spectator testing library.
Installation
-
Add the dependency to your
shard.yml
:development_dependencies: wisper-spectator: github: gmartsenkov/wisper-spectator
-
Run
shards install
Usage
require "wisper-spectator"
Spectator.describe "Wisper::Spectator" do
subject { User::Create.new(15) }
describe "#broadcast" do
it "works with a passed event class" do
subject.on(User::Create::Failure) do |failure|
expect(failure.reason).to eq "Some reason"
end
expect { subject.call }.to broadcast(User::Create::Failure)
end
end
end
Contributing
- Fork it (https://github.com/gmartsenkov/wisper-spectator/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Georgi Martsenkov - creator and maintainer