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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5160588ed7c7aea6fa2b5bd7d724b188068eec6e
4
- data.tar.gz: 39d0c2eda9bb4c9f7182e4de0ca66e906fd4aa42
3
+ metadata.gz: d746854e3e267689813fa8d8e24ddfa7db1e9eaa
4
+ data.tar.gz: fc4f7f593ddfa851824599e88101188a57a3b28c
5
5
  SHA512:
6
- metadata.gz: 8a560e5b111974eb836fd19f73d53615e5701e73000ebfbef51952705555b67e11c001caaa46057174482732463ac11d44ff82c01189023105cff5fe2dee491f
7
- data.tar.gz: c921ba2c535b4897c777644bf5c96108a6a94ec6a09382a93fcb1b9eba61e99a3d6a348367dd6a18fd2dd31be7af2f92c8e79cc371f2808605a99d4a26da4d1d
6
+ metadata.gz: 38dc367f4a821fcbdc3e88ea4d97ad5c20e53a54b31dbdec4e1f56a5e922a1692da7b4e96201d6578454649f2292b913957edfe55e251169ab2ff9fe706136e2
7
+ data.tar.gz: e12ac670b1a5a9d529e1826e674f8d7ec625f50d81626fab4493052977a739cb8459c21415e2f594a9f82cb7a5c0a95e9c09f9df1d499071868661c0c22138ee
@@ -1,4 +1,6 @@
1
+ sudo: false
1
2
  language: ruby
2
3
  rvm:
3
4
  - 1.9.3
4
5
  - 2.0.0
6
+ - 2.2.2
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
@@ -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'
@@ -1,3 +1,3 @@
1
1
  module FakeSQS
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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
 
@@ -1,5 +1,4 @@
1
1
  require "integration_spec_helper"
2
- require "pry"
3
2
 
4
3
  RSpec.describe "Actions for Queues", :sqs do
5
4
 
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.2.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-05-27 00:00:00.000000000 Z
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.5
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