rabbit_feed 2.3.4 → 2.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/example/non_rails_app/Gemfile.lock +4 -4
- data/example/rails_app/Gemfile.lock +2 -2
- data/lib/rabbit_feed/testing_support/rspec_matchers/publish_event.rb +15 -1
- data/lib/rabbit_feed/version.rb +1 -1
- data/spec/lib/rabbit_feed/testing_support/rspec_matchers/publish_event_spec.rb +16 -4
- 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: 13c0b3905b75108e5d82a42919b6e03339f948fd
|
4
|
+
data.tar.gz: 94fe1338ad1e1ee224f14936635286d8f71f8cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5d1e68fd21fa50fcedd8469b90eb114a325e853bc37093abea3bb61d29a958fd9fb9b50a8ee2d24c52ef2eb581fdcc15b6306a7922b236175e8f9bb42503637
|
7
|
+
data.tar.gz: 54c4625902a2d5115b2818630a37187cb349adeb00f09d26be7eb7c02e824fb04b36518447c21a6e673c3fc0e1f3ee84b96c879260b219a1c16a99f255e2f342
|
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.5)
|
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)
|
@@ -11,10 +11,10 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activemodel (4.2.
|
15
|
-
activesupport (= 4.2.
|
14
|
+
activemodel (4.2.5)
|
15
|
+
activesupport (= 4.2.5)
|
16
16
|
builder (~> 3.1)
|
17
|
-
activesupport (4.2.
|
17
|
+
activesupport (4.2.5)
|
18
18
|
i18n (~> 0.7)
|
19
19
|
json (~> 1.7, >= 1.7.7)
|
20
20
|
minitest (~> 5.1)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../
|
3
3
|
specs:
|
4
|
-
rabbit_feed (2.3.
|
4
|
+
rabbit_feed (2.3.5)
|
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)
|
@@ -11,10 +11,10 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activemodel (4.2.
|
15
|
-
activesupport (= 4.2.
|
14
|
+
activemodel (4.2.5)
|
15
|
+
activesupport (= 4.2.5)
|
16
16
|
builder (~> 3.1)
|
17
|
-
activesupport (4.2.
|
17
|
+
activesupport (4.2.5)
|
18
18
|
i18n (~> 0.7)
|
19
19
|
json (~> 1.7, >= 1.7.7)
|
20
20
|
minitest (~> 5.1)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../
|
3
3
|
specs:
|
4
|
-
rabbit_feed (2.3.
|
4
|
+
rabbit_feed (2.3.5)
|
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)
|
@@ -46,7 +46,7 @@ GEM
|
|
46
46
|
minitest (~> 5.1)
|
47
47
|
thread_safe (~> 0.3, >= 0.3.4)
|
48
48
|
tzinfo (~> 1.1)
|
49
|
-
amq-protocol (2.0.
|
49
|
+
amq-protocol (2.0.1)
|
50
50
|
arel (6.0.0)
|
51
51
|
avro (1.7.7)
|
52
52
|
multi_json
|
@@ -2,7 +2,7 @@ module RabbitFeed
|
|
2
2
|
module TestingSupport
|
3
3
|
module RSpecMatchers
|
4
4
|
class PublishEvent
|
5
|
-
attr_reader :expected_event
|
5
|
+
attr_reader :expected_event
|
6
6
|
|
7
7
|
def initialize(expected_event, expected_payload)
|
8
8
|
@expected_event = expected_event
|
@@ -59,8 +59,22 @@ module RabbitFeed
|
|
59
59
|
true
|
60
60
|
end
|
61
61
|
|
62
|
+
def with(expected_payload=nil, &block)
|
63
|
+
if !!@expected_payload
|
64
|
+
::Kernel.warn "`publish_event` was called with an expected payload already, anything in `with` is ignored"
|
65
|
+
else
|
66
|
+
@expected_payload = expected_payload
|
67
|
+
end
|
68
|
+
|
69
|
+
self
|
70
|
+
end
|
71
|
+
|
62
72
|
private
|
63
73
|
|
74
|
+
def expected_payload
|
75
|
+
@expected_payload.respond_to?(:call) ? @expected_payload.call : @expected_payload
|
76
|
+
end
|
77
|
+
|
64
78
|
def received_events_message
|
65
79
|
if TestingSupport.published_events.any?
|
66
80
|
TestingSupport.published_events.map do |received_event|
|
data/lib/rabbit_feed/version.rb
CHANGED
@@ -62,10 +62,22 @@ module RabbitFeed
|
|
62
62
|
(matcher.matches? block).should be_falsey
|
63
63
|
end
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
context 'when validating the payload' do
|
66
|
+
context 'and the payload is not a Proc' do
|
67
|
+
it 'validates the event payload' do
|
68
|
+
matcher = described_class.new(event_name, event_payload)
|
69
|
+
block = Proc.new { RabbitFeed::Producer.publish_event event_name, {'field' => 'different value'} }
|
70
|
+
(matcher.matches? block).should be_falsey
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'and the payload is a Proc' do
|
75
|
+
it 'validates the event payload' do
|
76
|
+
matcher = described_class.new(event_name, event_payload)
|
77
|
+
block = Proc.new { RabbitFeed::Producer.publish_event(event_name).with{{'field' => 'different value'}} }
|
78
|
+
(matcher.matches? block).should be_falsey
|
79
|
+
end
|
80
|
+
end
|
69
81
|
end
|
70
82
|
end
|
71
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simply Business
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|