rabbit_feed 2.3.5 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13c0b3905b75108e5d82a42919b6e03339f948fd
4
- data.tar.gz: 94fe1338ad1e1ee224f14936635286d8f71f8cce
3
+ metadata.gz: 100993651bddbcb662add54fe4db5be3db46439d
4
+ data.tar.gz: 5ae96791560268be3d76e40436269c767de1446f
5
5
  SHA512:
6
- metadata.gz: d5d1e68fd21fa50fcedd8469b90eb114a325e853bc37093abea3bb61d29a958fd9fb9b50a8ee2d24c52ef2eb581fdcc15b6306a7922b236175e8f9bb42503637
7
- data.tar.gz: 54c4625902a2d5115b2818630a37187cb349adeb00f09d26be7eb7c02e824fb04b36518447c21a6e673c3fc0e1f3ee84b96c879260b219a1c16a99f255e2f342
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.5)
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.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.5)
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.0)
23
+ amq-protocol (2.0.1)
24
24
  avro (1.7.7)
25
25
  multi_json
26
26
  builder (3.2.2)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- rabbit_feed (2.3.5)
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)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RabbitFeed
2
- VERSION = '2.3.5'
2
+ VERSION = '2.3.6'
3
3
  end
@@ -71,11 +71,21 @@ module RabbitFeed
71
71
  end
72
72
  end
73
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
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit_feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ version: 2.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simply Business