reactor 0.2.9 → 0.2.10

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: bd7f8f6737ea1370212d5abc5d9f43cd2325663e
4
- data.tar.gz: 4aba90707e1d8aa642510e575bf415b2fc1a0c13
3
+ metadata.gz: 3b3832777ade1de29503fe30b12109e238702e68
4
+ data.tar.gz: 74107e0eba5012638fee991e573050a51790e656
5
5
  SHA512:
6
- metadata.gz: 7b8245e6fdc7c246cdafd036dcd93046d242508b4d02dba60cedf0bf732ef901c5eafd7447ccbc0ec4a99af6ac17ad1b59f1f1c9875de67ae7d602296f91b342
7
- data.tar.gz: 815f1656650d8f2e46b4094759f8474d2177b440608218ef7a653eb9eec23bcd4ed29788f6b6e3fde94b495fb4b697fd7ef03fea00ca47eb7e6f1cb5f9b592cd
6
+ metadata.gz: 7236791284614629ec715b6f6ca1c93be6d9b6e1aafe03787e0f5918706786c96b729ad2be8324a0ace626863d5dc3b7be39aa2415b527ab8f8b41944fdc3bc5
7
+ data.tar.gz: afe337ddb5c6bfb53334c4c28a30a7bb8dd10a5a31898f6baa6bcfe42dbeb64ba8f561b7ba7d291611aabe4c2b536c173391c3194fdb9dd96ab3597f4bbda1fe
@@ -7,17 +7,18 @@ RSpec::Matchers.define :publish_event do |name, data = {}|
7
7
  end
8
8
  end
9
9
 
10
- RSpec::Matchers.define :publish_events do |*args|
10
+ RSpec::Matchers.define :publish_events do |*events|
11
11
 
12
12
  match do |block|
13
- defaults = {:actor => anything}
13
+ defaults = {:actor => anything, at: anything, target: anything}
14
+
15
+ Reactor::Event.should_receive(:publish).exactly(events.count).times.with do |event, data|
16
+ match = events.select { |e| (e.is_a?(Hash) ? e.keys.first : e) == event }.first
17
+ match.should be_present
14
18
 
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, hash_including(defaults.merge(event.values.first)))
19
+ expected = match.is_a?(Hash) ? match.values.first : {match => {}}
20
+ expected.each do |key, value|
21
+ value.should == expected[key]
21
22
  end
22
23
  end
23
24
  block.call
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.2.9"
2
+ VERSION = "0.2.10"
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.9
4
+ version: 0.2.10
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-08 00:00:00.000000000 Z
12
+ date: 2013-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler