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 +4 -4
- data/lib/reactor/testing/matchers.rb +9 -8
- data/lib/reactor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b3832777ade1de29503fe30b12109e238702e68
|
4
|
+
data.tar.gz: 74107e0eba5012638fee991e573050a51790e656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 |*
|
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
|
-
|
16
|
-
|
17
|
-
|
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
|
data/lib/reactor/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|