fastly_nsq 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/fastly_nsq/fake_message_queue.rb +2 -0
- data/lib/fastly_nsq/version.rb +1 -1
- data/test/lib/fastly_nsq/fake_message_queue_test.rb +18 -0
- data/test/test_helper.rb +0 -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: 95925013466f1c6030b499fcc757af3bb2ef9108
|
4
|
+
data.tar.gz: de2bf7042bd3c5e3321401292f85f90c711097e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6960321ea681e336e80ece23721a43e6314d1352866fa59b3ee5adb1ba851be9f4119e4514e3d07ed55dfeaefbb7b840d89380b215786524e495f2ef800bded
|
7
|
+
data.tar.gz: 029dc818205f8fa98c697d7de108ef6a4cb2d344f4a106eeca2ad1d18bcbb1475a7bd9800f2e6f44c39d4151201ac61ae9d698e728708c00e5f290ed4f990e5d
|
data/README.md
CHANGED
@@ -215,6 +215,11 @@ start by using the fake queue:
|
|
215
215
|
FAKE_QUEUE=true
|
216
216
|
```
|
217
217
|
|
218
|
+
Also be sure call
|
219
|
+
`FakeMessageQueue.reset!`
|
220
|
+
before each test in your app to ensure
|
221
|
+
there are no leftover messages.
|
222
|
+
|
218
223
|
Also note that during gem tests,
|
219
224
|
we are aliasing `MessageProcessor` to `SampleMessageProcessor`.
|
220
225
|
You can also refer to the latter
|
data/lib/fastly_nsq/version.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
describe FakeMessageQueue do
|
4
|
+
describe '@@queue' do
|
5
|
+
it 'is initalized as an empty array' do
|
6
|
+
assert_equal [], FakeMessageQueue.queue
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
4
10
|
describe '.reset!' do
|
5
11
|
it 'resets the fake message queue' do
|
6
12
|
FakeMessageQueue.queue = ['hello']
|
@@ -14,6 +20,10 @@ describe FakeMessageQueue do
|
|
14
20
|
end
|
15
21
|
|
16
22
|
describe FakeMessageQueue::Producer do
|
23
|
+
after do
|
24
|
+
FakeMessageQueue.reset!
|
25
|
+
end
|
26
|
+
|
17
27
|
describe '#write' do
|
18
28
|
it 'adds a new message to the queue' do
|
19
29
|
topic = 'death_star'
|
@@ -30,6 +40,10 @@ describe FakeMessageQueue::Producer do
|
|
30
40
|
end
|
31
41
|
|
32
42
|
describe FakeMessageQueue::Message do
|
43
|
+
after do
|
44
|
+
FakeMessageQueue.reset!
|
45
|
+
end
|
46
|
+
|
33
47
|
describe '#body' do
|
34
48
|
it 'returns the body of the message' do
|
35
49
|
topic = 'death_star'
|
@@ -49,6 +63,10 @@ describe FakeMessageQueue::Message do
|
|
49
63
|
end
|
50
64
|
|
51
65
|
describe FakeMessageQueue::Consumer do
|
66
|
+
after do
|
67
|
+
FakeMessageQueue.reset!
|
68
|
+
end
|
69
|
+
|
52
70
|
describe '#size' do
|
53
71
|
it 'tells you how many messages are in the queue' do
|
54
72
|
FakeMessageQueue.queue = ['hello']
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastly_nsq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy O'Neil
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: awesome_print
|