google-pubsub-enhancer 0.5.7 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/google_pubsub_enhancer/spec.rb +2 -5
- data/lib/google_pubsub_enhancer/version.rb +1 -1
- 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: 2067bce55a4418d118d8e65ee1495d21daadda81
|
4
|
+
data.tar.gz: a95da52e25d952377ecf48e555fa67d082c55964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efd4e7229adb6b022c55fb4d6bea92570eb59b7a9d264a7b2fe5293f9a0ede150e06929a34c26bb77a6ed1198a181ec85b4607ae5cd9174ac8618e551bae8bad
|
7
|
+
data.tar.gz: 3fa5ab956a2becf7800e5c6d665dbaafd48c92b167fe4e95ae7a14bdf4bc5ca18896cd89eeecd4e2b6b4b1302cbb142cd71d5ec3f825665ae98de4a927e1fb91
|
data/README.md
CHANGED
@@ -59,9 +59,6 @@ describe YourApplication do
|
|
59
59
|
#set messages that come from a topic
|
60
60
|
let(:messages) {[JSON.dump({foo:1}), JSON.dump({bar:2})]}
|
61
61
|
|
62
|
-
#set expected_messages that you expect to publish after your middleware's work done
|
63
|
-
let(:expected_messages) { [{"foo" => 1}, {"bar" => 2}]}
|
64
|
-
|
65
62
|
it "should do the magic you write into" do
|
66
63
|
|
67
64
|
app = GooglePubsubEnhancer.new do
|
@@ -79,7 +76,8 @@ describe YourApplication do
|
|
79
76
|
end
|
80
77
|
|
81
78
|
# the only expectation you need
|
82
|
-
publish_called_with
|
79
|
+
publish_called_with({"foo" => 1})
|
80
|
+
publish_called_with({"bar" => 2})
|
83
81
|
|
84
82
|
app.run 'subscription_short_name'
|
85
83
|
end
|
@@ -16,7 +16,6 @@ module GooglePubsubEnhancer::Spec
|
|
16
16
|
allow(publisher).to receive(:publish)
|
17
17
|
allow(subscription).to receive(:acknowledge)
|
18
18
|
allow(Digest::MD5).to receive(:hexdigest).and_return("a1s2d3f4g5")
|
19
|
-
|
20
19
|
end
|
21
20
|
|
22
21
|
after do
|
@@ -26,10 +25,8 @@ module GooglePubsubEnhancer::Spec
|
|
26
25
|
end
|
27
26
|
|
28
27
|
module PublisherTester
|
29
|
-
def publish_called_with(
|
30
|
-
|
31
|
-
expect(publisher).to receive(:publish).with(msg, {recordId: "a1s2d3f4g5"} )
|
32
|
-
end
|
28
|
+
def publish_called_with(msg)
|
29
|
+
expect(publisher).to receive(:publish).with(msg, {recordId: "a1s2d3f4g5"}).ordered
|
33
30
|
end
|
34
31
|
end
|
35
32
|
|