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 +4 -4
- data/lib/reactor/testing/matchers.rb +17 -5
- 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: 11b381d9bb11ca18a97ab86aaadea9222dbbe7aa
|
4
|
+
data.tar.gz: c6acdb372a0388c1216c24a935f0485d5988a87f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
-
|
6
|
-
|
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
|
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.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-
|
12
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|