wisper-spectator v0.1.0

Wisper.cr test helpers for Spectator

wisper-spectator

Handy Wisper.cr test helpers for the Spectator testing library.

Installation

  1. Add the dependency to your shard.yml:

    development_dependencies:
      wisper-spectator:
        github: gmartsenkov/wisper-spectator
    
  2. 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

  1. Fork it (https://github.com/gmartsenkov/wisper-spectator/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

wisper-spectator

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 2
  • about 2 years ago
  • September 7, 2022
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 23:27:42 GMT

Languages