fastly_nsq 0.1.3 → 0.1.4

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: ed99890b9268655e4d1e7b151e53274bcbe147c9
4
- data.tar.gz: 42d9dffa0b05e5a02be41dd92192c3a3f9834462
3
+ metadata.gz: 95925013466f1c6030b499fcc757af3bb2ef9108
4
+ data.tar.gz: de2bf7042bd3c5e3321401292f85f90c711097e5
5
5
  SHA512:
6
- metadata.gz: 81b4855596f0aa86d2457ac2e1375e086999fb37b62be50b6f39d5895de51c34cf807b08355963697062423591dfa69e02567b7b2e1610b097e86caa33472cd2
7
- data.tar.gz: b4e51dada6b9cb4b2ac0110911dd86a029be91ed4f3cf8f542095acb68333ba16a8c23f2879a26822b3fcd60cc2b3b4d8aae022e47e7a3438b7ff3c8ca81637b
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
@@ -1,4 +1,6 @@
1
1
  module FakeMessageQueue
2
+ @@queue = []
3
+
2
4
  def self.queue
3
5
  @@queue
4
6
  end
@@ -1,3 +1,3 @@
1
1
  module FastlyNsq
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
@@ -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
@@ -17,7 +17,6 @@ MessageProcessor = SampleMessageProcessor
17
17
 
18
18
  MiniTest::Spec.before do
19
19
  load_sample_environment_variables
20
- FakeMessageQueue.reset!
21
20
  end
22
21
 
23
22
  def load_sample_environment_variables
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.3
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-03 00:00:00.000000000 Z
12
+ date: 2016-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: awesome_print