rabbit_feed 2.3.5 → 2.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/example/non_rails_app/Gemfile.lock +2 -2
- data/example/rails_app/Gemfile.lock +1 -1
- data/lib/rabbit_feed/testing_support/rspec_matchers/publish_event.rb +1 -1
- data/lib/rabbit_feed/version.rb +1 -1
- data/spec/lib/rabbit_feed/testing_support/rspec_matchers/publish_event_spec.rb +15 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 100993651bddbcb662add54fe4db5be3db46439d
|
4
|
+
data.tar.gz: 5ae96791560268be3d76e40436269c767de1446f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d729b0569a3bd6d8467bb561f36223b8d8b6d058efc0bd54f24f2670b0f249faff7181bf42bd38ce4cad3044e7746919274945dff20a2638c56342deac3ae4a9
|
7
|
+
data.tar.gz: e0a7f4a72d52d06857d4fed99ac5ddeb22adb8eefc6ffcfa8244dbe0859740b188d0520213fce8766726d56c2726239cf4cf781a9c17fa25b0dfc2f7a6bd72c9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rabbit_feed (2.3.
|
4
|
+
rabbit_feed (2.3.6)
|
5
5
|
activemodel (>= 3.2.0, < 5.0.0)
|
6
6
|
activesupport (>= 3.2.0, < 5.0.0)
|
7
7
|
avro (>= 1.5.4, < 1.8.0)
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
minitest (~> 5.1)
|
21
21
|
thread_safe (~> 0.3, >= 0.3.4)
|
22
22
|
tzinfo (~> 1.1)
|
23
|
-
amq-protocol (2.0.
|
23
|
+
amq-protocol (2.0.1)
|
24
24
|
avro (1.7.7)
|
25
25
|
multi_json
|
26
26
|
binding_of_caller (0.7.2)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../
|
3
3
|
specs:
|
4
|
-
rabbit_feed (2.3.
|
4
|
+
rabbit_feed (2.3.6)
|
5
5
|
activemodel (>= 3.2.0, < 5.0.0)
|
6
6
|
activesupport (>= 3.2.0, < 5.0.0)
|
7
7
|
avro (>= 1.5.4, < 1.8.0)
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
minitest (~> 5.1)
|
21
21
|
thread_safe (~> 0.3, >= 0.3.4)
|
22
22
|
tzinfo (~> 1.1)
|
23
|
-
amq-protocol (2.0.
|
23
|
+
amq-protocol (2.0.1)
|
24
24
|
avro (1.7.7)
|
25
25
|
multi_json
|
26
26
|
builder (3.2.2)
|
@@ -63,7 +63,7 @@ module RabbitFeed
|
|
63
63
|
if !!@expected_payload
|
64
64
|
::Kernel.warn "`publish_event` was called with an expected payload already, anything in `with` is ignored"
|
65
65
|
else
|
66
|
-
@expected_payload = expected_payload
|
66
|
+
@expected_payload = expected_payload || block
|
67
67
|
end
|
68
68
|
|
69
69
|
self
|
data/lib/rabbit_feed/version.rb
CHANGED
@@ -71,11 +71,21 @@ module RabbitFeed
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
context '
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
context 'uses .with' do
|
75
|
+
context 'and it is not a Proc' do
|
76
|
+
it 'validates the event payload' do
|
77
|
+
matcher = described_class.new(event_name, nil).with(event_payload)
|
78
|
+
block = Proc.new { RabbitFeed::Producer.publish_event event_name, {'field' => 'different value'} }
|
79
|
+
(matcher.matches? block).should be false
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context 'and it is a Proc' do
|
84
|
+
it 'validates the event payload' do
|
85
|
+
matcher = described_class.new(event_name, nil).with{event_payload}
|
86
|
+
block = Proc.new { RabbitFeed::Producer.publish_event event_name, {'field' => 'different value'} }
|
87
|
+
(matcher.matches? block).should be false
|
88
|
+
end
|
79
89
|
end
|
80
90
|
end
|
81
91
|
end
|