reactor 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e63dbb0bcf3a8396d130eeb955538359cd9551d
4
- data.tar.gz: 704feccc84221143a8b90f7a86d139f7b6e91682
3
+ metadata.gz: 11b381d9bb11ca18a97ab86aaadea9222dbbe7aa
4
+ data.tar.gz: c6acdb372a0388c1216c24a935f0485d5988a87f
5
5
  SHA512:
6
- metadata.gz: a68f0f4b9cdb3bf696b66538f1a3dbc0cca8f840d8b2de18cabb7e904b0539efaa4caffdbbef46cf44cc0fe81c7996122eec0005268a7f943b1df334e54a855e
7
- data.tar.gz: 0d3ba40af3fb198544d7b7d150a8c3b1ee312af095b304dd3e334c56ebad0b6915326d2ed881be0fbed4fc3c5eea08ea7985e239b54419bed136f69be6ecc512
6
+ metadata.gz: fbf46bddce45734a1b148f0f465a4b9df670c920ffb09f993dd88212f2f2aa5076b925d22ec1c480ae0f11a1dcd6aef20e351823a6949a0d77fa77646c297e3f
7
+ data.tar.gz: 9128b250d3df113a4cefe7c668b48cbf6c3e773c64abf8dbc869a39b7c24af1eefa8188272018feded6967963af7266956c83b6499c3986cf1c6024dbdcadcf5
@@ -1,12 +1,24 @@
1
1
  RSpec::Matchers.define :publish_event do |name, data = {}|
2
2
 
3
3
  match do |block|
4
- if data.empty?
5
- Reactor::Event.should_receive(:publish).with do |*args|
6
- args.first.should == name
4
+ defaults = {:actor => anything, :target => anything}
5
+ Reactor::Event.should_receive(:publish).with(name, defaults.merge(data))
6
+ block.call
7
+ end
8
+ end
9
+
10
+ RSpec::Matchers.define :publish_events do |*args|
11
+
12
+ match do |block|
13
+ defaults = {:actor => anything, :target => anything}
14
+
15
+ args.each do |event|
16
+ case event
17
+ when Symbol
18
+ Reactor::Event.should_receive(:publish).with(event, anything)
19
+ when Hash
20
+ Reactor::Event.should_receive(:publish).with(event.keys.first, defaults.merge(event.values.first))
7
21
  end
8
- else
9
- Reactor::Event.should_receive(:publish).with(name, data)
10
22
  end
11
23
  block.call
12
24
  end
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - winfred
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-05 00:00:00.000000000 Z
12
+ date: 2013-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler