fake_sqs 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +1 -0
- data/lib/fake_sqs/actions/purge_queue.rb +19 -0
- data/lib/fake_sqs/api.rb +1 -0
- data/lib/fake_sqs/version.rb +1 -1
- data/spec/acceptance/message_actions_spec.rb +20 -0
- data/spec/acceptance/queue_actions_spec.rb +0 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d746854e3e267689813fa8d8e24ddfa7db1e9eaa
|
4
|
+
data.tar.gz: fc4f7f593ddfa851824599e88101188a57a3b28c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38dc367f4a821fcbdc3e88ea4d97ad5c20e53a54b31dbdec4e1f56a5e922a1692da7b4e96201d6578454649f2292b913957edfe55e251169ab2ff9fe706136e2
|
7
|
+
data.tar.gz: e12ac670b1a5a9d529e1826e674f8d7ec625f50d81626fab4493052977a739cb8459c21415e2f594a9f82cb7a5c0a95e9c09f9df1d499071868661c0c22138ee
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -19,6 +19,7 @@ Done so far are:
|
|
19
19
|
* Deleting messages (and in batch)
|
20
20
|
* Changing queue attributes (but not all, and no validation)
|
21
21
|
* Setting visibility timeouts for messages
|
22
|
+
* Purge Queue
|
22
23
|
|
23
24
|
Certain bits are left off on purpose, to make it easier to work with, such as:
|
24
25
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module FakeSQS
|
2
|
+
module Actions
|
3
|
+
class PurgeQueue
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
@server = options.fetch(:server)
|
7
|
+
@queues = options.fetch(:queues)
|
8
|
+
@responder = options.fetch(:responder)
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(name, params)
|
12
|
+
queue = @queues.get(name)
|
13
|
+
queue.reset()
|
14
|
+
@responder.call :PurgeQueue
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/fake_sqs/api.rb
CHANGED
@@ -7,6 +7,7 @@ require 'fake_sqs/actions/send_message'
|
|
7
7
|
require 'fake_sqs/actions/receive_message'
|
8
8
|
require 'fake_sqs/actions/delete_message'
|
9
9
|
require 'fake_sqs/actions/delete_message_batch'
|
10
|
+
require 'fake_sqs/actions/purge_queue'
|
10
11
|
require 'fake_sqs/actions/send_message_batch'
|
11
12
|
require 'fake_sqs/actions/get_queue_attributes'
|
12
13
|
require 'fake_sqs/actions/set_queue_attributes'
|
data/lib/fake_sqs/version.rb
CHANGED
@@ -101,6 +101,26 @@ RSpec.describe "Actions for Messages", :sqs do
|
|
101
101
|
expect(response.messages.size).to eq 0
|
102
102
|
end
|
103
103
|
|
104
|
+
specify "PurgeQueue" do
|
105
|
+
sqs.send_message(
|
106
|
+
queue_url: queue_url,
|
107
|
+
message_body: "test1"
|
108
|
+
)
|
109
|
+
sqs.send_message(
|
110
|
+
queue_url: queue_url,
|
111
|
+
message_body: "test2"
|
112
|
+
)
|
113
|
+
|
114
|
+
sqs.purge_queue(
|
115
|
+
queue_url: queue_url,
|
116
|
+
)
|
117
|
+
|
118
|
+
response = sqs.receive_message(
|
119
|
+
queue_url: queue_url,
|
120
|
+
)
|
121
|
+
expect(response.messages.size).to eq 0
|
122
|
+
end
|
123
|
+
|
104
124
|
specify "SendMessageBatch" do
|
105
125
|
bodies = %w(a b c)
|
106
126
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_sqs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/fake_sqs/actions/get_queue_attributes.rb
|
163
163
|
- lib/fake_sqs/actions/get_queue_url.rb
|
164
164
|
- lib/fake_sqs/actions/list_queues.rb
|
165
|
+
- lib/fake_sqs/actions/purge_queue.rb
|
165
166
|
- lib/fake_sqs/actions/receive_message.rb
|
166
167
|
- lib/fake_sqs/actions/send_message.rb
|
167
168
|
- lib/fake_sqs/actions/send_message_batch.rb
|
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
219
|
version: '0'
|
219
220
|
requirements: []
|
220
221
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.4.
|
222
|
+
rubygems_version: 2.4.8
|
222
223
|
signing_key:
|
223
224
|
specification_version: 4
|
224
225
|
summary: Provides a fake SQS server that you can run locally to test against
|