Sha256: 561968bd88e424a0ca1ffee231e8c0a9da1c4e83daa359df5a5d02e2de731bac

Contents?: true

Size: 308 Bytes

Versions: 13

Compression:

Stored size: 308 Bytes

Contents

RSpec::Matchers.define :publish_event do |name, data = {}|

  match do |block|
    if data.empty?
      Reactor::Event.should_receive(:publish).with do |*args|
        args.first.should == name
      end
    else
      Reactor::Event.should_receive(:publish).with(name, data)
    end
    block.call
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
reactor-0.2.6 lib/reactor/testing/matchers.rb
reactor-0.2.5 lib/reactor/testing/matchers.rb
reactor-0.2.4 lib/reactor/testing/matchers.rb
reactor-0.2.3 lib/reactor/testing/matchers.rb
reactor-0.2.2 lib/reactor/testing/matchers.rb
reactor-0.2.1 lib/reactor/testing/matchers.rb
reactor-0.2.0 lib/reactor/testing/matchers.rb
reactor-0.1.4 lib/reactor/testing/matchers.rb
reactor-0.1.3 lib/reactor/testing/matchers.rb
reactor-0.1.2 lib/reactor/testing/matchers.rb
reactor-0.1.1 lib/reactor/testing/matchers.rb
reactor-0.1.0 lib/reactor/testing/matchers.rb
reactor-0.0.1 lib/reactor/testing/matchers.rb