fake_sqs 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/fake_sqs.gemspec +1 -1
- data/lib/fake_sqs.rb +4 -2
- data/lib/fake_sqs/show_output.rb +3 -2
- data/lib/fake_sqs/test_integration.rb +5 -1
- data/lib/fake_sqs/version.rb +1 -1
- data/spec/acceptance/message_actions_spec.rb +163 -51
- data/spec/acceptance/queue_actions_spec.rb +36 -30
- data/spec/integration_spec_helper.rb +29 -0
- data/spec/spec_helper.rb +1 -21
- data/spec/unit/api_spec.rb +5 -5
- data/spec/unit/catch_errors_spec.rb +9 -9
- data/spec/unit/collection_view_spec.rb +14 -14
- data/spec/unit/error_response_spec.rb +11 -11
- data/spec/unit/message_spec.rb +9 -9
- data/spec/unit/queue_factory_spec.rb +2 -2
- data/spec/unit/queue_spec.rb +25 -25
- data/spec/unit/queues_spec.rb +13 -13
- data/spec/unit/responder_spec.rb +8 -8
- data/spec/unit/show_output_spec.rb +3 -3
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5160588ed7c7aea6fa2b5bd7d724b188068eec6e
|
4
|
+
data.tar.gz: 39d0c2eda9bb4c9f7182e4de0ca66e906fd4aa42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a560e5b111974eb836fd19f73d53615e5701e73000ebfbef51952705555b67e11c001caaa46057174482732463ac11d44ff82c01189023105cff5fe2dee491f
|
7
|
+
data.tar.gz: c921ba2c535b4897c777644bf5c96108a6a94ec6a09382a93fcb1b9eba61e99a3d6a348367dd6a18fd2dd31be7af2f92c8e79cc371f2808605a99d4a26da4d1d
|
data/.rspec
CHANGED
data/fake_sqs.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
|
24
24
|
gem.add_development_dependency "rspec"
|
25
25
|
gem.add_development_dependency "rake"
|
26
|
-
gem.add_development_dependency "aws-sdk"
|
26
|
+
gem.add_development_dependency "aws-sdk", "~> 2.0"
|
27
27
|
gem.add_development_dependency "faraday"
|
28
28
|
gem.add_development_dependency "thin"
|
29
29
|
gem.add_development_dependency "verbose_hash_fetch"
|
data/lib/fake_sqs.rb
CHANGED
@@ -20,8 +20,10 @@ module FakeSQS
|
|
20
20
|
app = FakeSQS::WebInterface
|
21
21
|
|
22
22
|
if (log = options[:log])
|
23
|
-
|
24
|
-
|
23
|
+
file = File.new(log, "a+")
|
24
|
+
file.sync = true
|
25
|
+
app.use Rack::CommonLogger, file
|
26
|
+
app.set :log_file, file
|
25
27
|
app.enable :logging
|
26
28
|
end
|
27
29
|
|
data/lib/fake_sqs/show_output.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
require 'rack
|
1
|
+
require 'rack'
|
2
|
+
require 'yaml'
|
2
3
|
|
3
4
|
module FakeSQS
|
4
5
|
class ShowOutput
|
@@ -12,7 +13,7 @@ module FakeSQS
|
|
12
13
|
result = @app.call(env)
|
13
14
|
puts request.params.to_yaml
|
14
15
|
puts
|
15
|
-
puts
|
16
|
+
puts(*result.last)
|
16
17
|
result
|
17
18
|
end
|
18
19
|
|
@@ -50,6 +50,10 @@ module FakeSQS
|
|
50
50
|
"http://#{host}:#{port}"
|
51
51
|
end
|
52
52
|
|
53
|
+
def uri
|
54
|
+
URI(url)
|
55
|
+
end
|
56
|
+
|
53
57
|
def up?
|
54
58
|
@pid && connection.get("/").code.to_s == "200"
|
55
59
|
rescue Errno::ECONNREFUSED
|
@@ -59,7 +63,7 @@ module FakeSQS
|
|
59
63
|
private
|
60
64
|
|
61
65
|
def option(key)
|
62
|
-
options.fetch(key)
|
66
|
+
options.fetch(key)
|
63
67
|
end
|
64
68
|
|
65
69
|
def database
|
data/lib/fake_sqs/version.rb
CHANGED
@@ -1,99 +1,211 @@
|
|
1
|
-
require "
|
1
|
+
require "integration_spec_helper"
|
2
|
+
require "securerandom"
|
2
3
|
|
3
|
-
describe "Actions for Messages", :sqs do
|
4
|
+
RSpec.describe "Actions for Messages", :sqs do
|
5
|
+
|
6
|
+
QUEUE_NAME = "test"
|
4
7
|
|
5
8
|
before do
|
6
|
-
sqs.
|
9
|
+
sqs.config.endpoint = $fake_sqs.uri
|
10
|
+
sqs.create_queue(queue_name: QUEUE_NAME)
|
7
11
|
end
|
8
12
|
|
9
|
-
let(:sqs) {
|
10
|
-
|
13
|
+
let(:sqs) { Aws::SQS::Client.new }
|
14
|
+
|
15
|
+
let(:queue_url) { sqs.get_queue_url(queue_name: QUEUE_NAME).queue_url }
|
11
16
|
|
12
17
|
specify "SendMessage" do
|
13
18
|
msg = "this is my message"
|
14
|
-
|
15
|
-
result
|
19
|
+
|
20
|
+
result = sqs.send_message(
|
21
|
+
queue_url: queue_url,
|
22
|
+
message_body: msg,
|
23
|
+
)
|
24
|
+
|
25
|
+
expect(result.md5_of_message_body).to eq Digest::MD5.hexdigest(msg)
|
26
|
+
expect(result.message_id.size).to eq 36
|
16
27
|
end
|
17
28
|
|
18
29
|
specify "ReceiveMessage" do
|
19
30
|
body = "test 123"
|
20
|
-
|
21
|
-
|
22
|
-
|
31
|
+
|
32
|
+
sqs.send_message(
|
33
|
+
queue_url: queue_url,
|
34
|
+
message_body: body
|
35
|
+
)
|
36
|
+
|
37
|
+
response = sqs.receive_message(
|
38
|
+
queue_url: queue_url,
|
39
|
+
)
|
40
|
+
|
41
|
+
expect(response.messages.size).to eq 1
|
42
|
+
|
43
|
+
expect(response.messages.first.body).to eq body
|
23
44
|
end
|
24
45
|
|
25
46
|
specify "DeleteMessage" do
|
26
|
-
|
47
|
+
sqs.send_message(
|
48
|
+
queue_url: queue_url,
|
49
|
+
message_body: "test",
|
50
|
+
)
|
27
51
|
|
28
|
-
message1 =
|
29
|
-
|
52
|
+
message1 = sqs.receive_message(
|
53
|
+
queue_url: queue_url,
|
54
|
+
).messages.first
|
55
|
+
|
56
|
+
sqs.delete_message(
|
57
|
+
queue_url: queue_url,
|
58
|
+
receipt_handle: message1.receipt_handle,
|
59
|
+
)
|
30
60
|
|
31
61
|
let_messages_in_flight_expire
|
32
62
|
|
33
|
-
|
34
|
-
|
63
|
+
response = sqs.receive_message(
|
64
|
+
queue_url: queue_url,
|
65
|
+
)
|
66
|
+
expect(response.messages.size).to eq 0
|
35
67
|
end
|
36
68
|
|
37
69
|
specify "DeleteMessageBatch" do
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
70
|
+
sqs.send_message(
|
71
|
+
queue_url: queue_url,
|
72
|
+
message_body: "test1"
|
73
|
+
)
|
74
|
+
sqs.send_message(
|
75
|
+
queue_url: queue_url,
|
76
|
+
message_body: "test2"
|
77
|
+
)
|
78
|
+
|
79
|
+
messages_response = sqs.receive_message(
|
80
|
+
queue_url: queue_url,
|
81
|
+
max_number_of_messages: 2,
|
82
|
+
)
|
83
|
+
|
84
|
+
entries = messages_response.messages.map { |msg|
|
85
|
+
{
|
86
|
+
id: SecureRandom.uuid,
|
87
|
+
receipt_handle: msg.receipt_handle,
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
sqs.delete_message_batch(
|
92
|
+
queue_url: queue_url,
|
93
|
+
entries: entries,
|
94
|
+
)
|
44
95
|
|
45
96
|
let_messages_in_flight_expire
|
46
97
|
|
47
|
-
|
48
|
-
|
98
|
+
response = sqs.receive_message(
|
99
|
+
queue_url: queue_url,
|
100
|
+
)
|
101
|
+
expect(response.messages.size).to eq 0
|
49
102
|
end
|
50
103
|
|
51
104
|
specify "SendMessageBatch" do
|
52
105
|
bodies = %w(a b c)
|
53
|
-
queue.batch_send(*bodies)
|
54
106
|
|
55
|
-
|
56
|
-
|
107
|
+
sqs.send_message_batch(
|
108
|
+
queue_url: queue_url,
|
109
|
+
entries: bodies.map { |bd|
|
110
|
+
{
|
111
|
+
id: SecureRandom.uuid,
|
112
|
+
message_body: bd,
|
113
|
+
}
|
114
|
+
}
|
115
|
+
)
|
116
|
+
|
117
|
+
messages_response = sqs.receive_message(
|
118
|
+
queue_url: queue_url,
|
119
|
+
max_number_of_messages: 3,
|
120
|
+
)
|
121
|
+
|
122
|
+
expect(messages_response.messages.map(&:body)).to match_array bodies
|
57
123
|
end
|
58
124
|
|
59
125
|
specify "set message timeout to 0" do
|
60
126
|
body = 'some-sample-message'
|
61
|
-
queue.send_message(body)
|
62
|
-
message = queue.receive_message
|
63
|
-
message.body.should == body
|
64
|
-
message.visibility_timeout = 0
|
65
127
|
|
66
|
-
|
67
|
-
|
128
|
+
sqs.send_message(
|
129
|
+
queue_url: queue_url,
|
130
|
+
message_body: body,
|
131
|
+
)
|
132
|
+
|
133
|
+
message = sqs.receive_message(
|
134
|
+
queue_url: queue_url,
|
135
|
+
).messages.first
|
136
|
+
|
137
|
+
expect(message.body).to eq body
|
138
|
+
|
139
|
+
sqs.change_message_visibility(
|
140
|
+
queue_url: queue_url,
|
141
|
+
receipt_handle: message.receipt_handle,
|
142
|
+
visibility_timeout: 0
|
143
|
+
)
|
144
|
+
|
145
|
+
same_message = sqs.receive_message(
|
146
|
+
queue_url: queue_url,
|
147
|
+
).messages.first
|
148
|
+
expect(same_message.body).to eq body
|
68
149
|
end
|
69
150
|
|
70
151
|
specify 'set message timeout and wait for message to come' do
|
71
152
|
|
72
153
|
body = 'some-sample-message'
|
73
|
-
queue.send_message(body)
|
74
|
-
message = queue.receive_message
|
75
|
-
message.body.should == body
|
76
|
-
message.visibility_timeout = 3
|
77
|
-
|
78
|
-
nothing = queue.receive_message
|
79
|
-
nothing.should be_nil
|
80
|
-
|
81
|
-
sleep(10)
|
82
154
|
|
83
|
-
|
84
|
-
|
155
|
+
sqs.send_message(
|
156
|
+
queue_url: queue_url,
|
157
|
+
message_body: body,
|
158
|
+
)
|
159
|
+
|
160
|
+
message = sqs.receive_message(
|
161
|
+
queue_url: queue_url,
|
162
|
+
).messages.first
|
163
|
+
expect(message.body).to eq body
|
164
|
+
|
165
|
+
sqs.change_message_visibility(
|
166
|
+
queue_url: queue_url,
|
167
|
+
receipt_handle: message.receipt_handle,
|
168
|
+
visibility_timeout: 2
|
169
|
+
)
|
170
|
+
|
171
|
+
nothing = sqs.receive_message(
|
172
|
+
queue_url: queue_url,
|
173
|
+
)
|
174
|
+
expect(nothing.messages.size).to eq 0
|
175
|
+
|
176
|
+
sleep(5)
|
177
|
+
|
178
|
+
same_message = sqs.receive_message(
|
179
|
+
queue_url: queue_url,
|
180
|
+
).messages.first
|
181
|
+
expect(same_message.body).to eq body
|
85
182
|
end
|
86
183
|
|
87
184
|
specify 'should fail if trying to update the visibility_timeout for a message that is not in flight' do
|
88
185
|
body = 'some-sample-message'
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
186
|
+
sqs.send_message(
|
187
|
+
queue_url: queue_url,
|
188
|
+
message_body: body,
|
189
|
+
)
|
190
|
+
|
191
|
+
message = sqs.receive_message(
|
192
|
+
queue_url: queue_url,
|
193
|
+
).messages.first
|
194
|
+
expect(message.body).to eq body
|
195
|
+
|
196
|
+
sqs.change_message_visibility(
|
197
|
+
queue_url: queue_url,
|
198
|
+
receipt_handle: message.receipt_handle,
|
199
|
+
visibility_timeout: 0
|
200
|
+
)
|
201
|
+
|
202
|
+
expect {
|
203
|
+
sqs.change_message_visibility(
|
204
|
+
queue_url: queue_url,
|
205
|
+
receipt_handle: message.receipt_handle,
|
206
|
+
visibility_timeout: 30
|
207
|
+
)
|
208
|
+
}.to raise_error(Aws::SQS::Errors::MessageNotInflight)
|
97
209
|
end
|
98
210
|
|
99
211
|
def let_messages_in_flight_expire
|
@@ -1,61 +1,67 @@
|
|
1
|
-
require "
|
1
|
+
require "integration_spec_helper"
|
2
|
+
require "pry"
|
2
3
|
|
3
|
-
describe "Actions for Queues", :sqs do
|
4
|
+
RSpec.describe "Actions for Queues", :sqs do
|
4
5
|
|
5
|
-
let(:sqs) {
|
6
|
+
let(:sqs) { Aws::SQS::Client.new }
|
7
|
+
before do
|
8
|
+
sqs.config.endpoint = $fake_sqs.uri
|
9
|
+
end
|
6
10
|
|
7
11
|
specify "CreateQueue" do
|
8
|
-
|
9
|
-
|
10
|
-
|
12
|
+
response = sqs.create_queue(queue_name: "test-create-queue")
|
13
|
+
expect(response.queue_url).to eq "http://0.0.0.0:4568/test-create-queue"
|
14
|
+
response2 = sqs.get_queue_attributes(queue_url: response.queue_url)
|
15
|
+
expect(response2.attributes.fetch("QueueArn")).to match %r"arn:aws:sqs:us-east-1:.+:test-create-queue"
|
11
16
|
end
|
12
17
|
|
13
18
|
specify "GetQueueUrl" do
|
14
|
-
sqs.
|
15
|
-
|
16
|
-
|
19
|
+
sqs.create_queue(queue_name: "test-get-queue-url")
|
20
|
+
response = sqs.get_queue_url(queue_name: "test-get-queue-url")
|
21
|
+
expect(response.queue_url).to eq "http://0.0.0.0:4568/test-get-queue-url"
|
17
22
|
end
|
18
23
|
|
19
24
|
specify "ListQueues" do
|
20
|
-
sqs.
|
21
|
-
sqs.
|
22
|
-
sqs.
|
25
|
+
sqs.create_queue(queue_name: "test-list-1")
|
26
|
+
sqs.create_queue(queue_name: "test-list-2")
|
27
|
+
expect(sqs.list_queues.queue_urls).to eq [
|
23
28
|
"http://0.0.0.0:4568/test-list-1",
|
24
29
|
"http://0.0.0.0:4568/test-list-2"
|
25
30
|
]
|
26
31
|
end
|
27
32
|
|
28
33
|
specify "ListQueues with prefix" do
|
29
|
-
sqs.
|
30
|
-
sqs.
|
31
|
-
sqs.
|
32
|
-
sqs.
|
34
|
+
sqs.create_queue(queue_name: "test-list-1")
|
35
|
+
sqs.create_queue(queue_name: "test-list-2")
|
36
|
+
sqs.create_queue(queue_name: "other-list-3")
|
37
|
+
expect(sqs.list_queues(queue_name_prefix: "test").queue_urls).to eq [
|
33
38
|
"http://0.0.0.0:4568/test-list-1",
|
34
39
|
"http://0.0.0.0:4568/test-list-2",
|
35
40
|
]
|
36
41
|
end
|
37
42
|
|
38
43
|
specify "DeleteQueue" do
|
39
|
-
url = sqs.
|
40
|
-
sqs.
|
41
|
-
sqs.
|
42
|
-
sqs.
|
44
|
+
url = sqs.create_queue(queue_name: "test-delete").queue_url
|
45
|
+
expect(sqs.list_queues.queue_urls.size).to eq 1
|
46
|
+
sqs.delete_queue(queue_url: url)
|
47
|
+
expect(sqs.list_queues.queue_urls.size).to eq 0
|
43
48
|
end
|
44
49
|
|
45
50
|
specify "SetQueueAttributes / GetQueueAttributes" do
|
51
|
+
queue_url = sqs.create_queue(queue_name: "my-queue").queue_url
|
46
52
|
|
47
|
-
policy = AWS::SQS::Policy.new
|
48
|
-
policy.allow(
|
49
|
-
:actions => ['s3:PutObject'],
|
50
|
-
:resources => "arn:aws:s3:::mybucket/mykey/*",
|
51
|
-
:principals => :any
|
52
|
-
).where(:acl).is("public-read")
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
sqs.set_queue_attributes(
|
55
|
+
queue_url: queue_url,
|
56
|
+
attributes: {
|
57
|
+
"DelaySeconds" => "900"
|
58
|
+
}
|
59
|
+
)
|
56
60
|
|
57
|
-
|
58
|
-
|
61
|
+
response = sqs.get_queue_attributes(
|
62
|
+
queue_url: queue_url,
|
63
|
+
)
|
64
|
+
expect(response.attributes.fetch("DelaySeconds")).to eq "900"
|
59
65
|
end
|
60
66
|
|
61
67
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "aws-sdk"
|
2
|
+
require "fake_sqs/test_integration"
|
3
|
+
|
4
|
+
# Aws.config[:credentials] = {
|
5
|
+
# :use_ssl => false,
|
6
|
+
# :sqs_endpoint => "localhost",
|
7
|
+
# :sqs_port => 4568,
|
8
|
+
# :access_key_id => "fake access key",
|
9
|
+
# :secret_access_key => "fake secret key",
|
10
|
+
# }
|
11
|
+
Aws.config.update(
|
12
|
+
region: "us-east-1",
|
13
|
+
credentials: Aws::Credentials.new("fake", "fake"),
|
14
|
+
)
|
15
|
+
|
16
|
+
db = ENV["SQS_DATABASE"] || ":memory:"
|
17
|
+
puts "\n\e[34mRunning specs with database \e[33m#{db}\e[0m"
|
18
|
+
|
19
|
+
$fake_sqs = FakeSQS::TestIntegration.new(
|
20
|
+
database: db,
|
21
|
+
sqs_endpoint: "localhost",
|
22
|
+
sqs_port: 4568,
|
23
|
+
)
|
24
|
+
|
25
|
+
RSpec.configure do |config|
|
26
|
+
config.before(:each, :sqs) { $fake_sqs.start }
|
27
|
+
config.before(:each, :sqs) { $fake_sqs.reset }
|
28
|
+
config.after(:suite) { $fake_sqs.stop }
|
29
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,23 +1,3 @@
|
|
1
|
-
require "aws-sdk"
|
2
|
-
require "fake_sqs/test_integration"
|
3
|
-
|
4
|
-
AWS.config(
|
5
|
-
:use_ssl => false,
|
6
|
-
:sqs_endpoint => "localhost",
|
7
|
-
:sqs_port => 4568,
|
8
|
-
:access_key_id => "fake access key",
|
9
|
-
:secret_access_key => "fake secret key",
|
10
|
-
)
|
11
|
-
|
12
|
-
db = ENV["SQS_DATABASE"] || ":memory:"
|
13
|
-
puts "\n\e[34mRunning specs with database \e[33m#{db}\e[0m"
|
14
|
-
$fake_sqs = FakeSQS::TestIntegration.new(database: db)
|
15
|
-
|
16
1
|
RSpec.configure do |config|
|
17
|
-
|
18
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
19
|
-
config.before(:each, :sqs) { $fake_sqs.start }
|
20
|
-
config.before(:each, :sqs) { $fake_sqs.reset }
|
21
|
-
config.after(:suite) { $fake_sqs.stop }
|
22
|
-
|
2
|
+
config.disable_monkey_patching!
|
23
3
|
end
|
data/spec/unit/api_spec.rb
CHANGED
@@ -12,7 +12,7 @@ class FakeSQS::Actions::TheAction
|
|
12
12
|
|
13
13
|
end
|
14
14
|
|
15
|
-
describe FakeSQS::API do
|
15
|
+
RSpec.describe FakeSQS::API do
|
16
16
|
|
17
17
|
it "delegates actions to classes" do
|
18
18
|
queues = double :queues
|
@@ -21,8 +21,8 @@ describe FakeSQS::API do
|
|
21
21
|
|
22
22
|
response = api.call("TheAction", {:foo => "bar"})
|
23
23
|
|
24
|
-
response[:options].
|
25
|
-
response[:params].
|
24
|
+
expect(response[:options]).to eq :queues => queues
|
25
|
+
expect(response[:params]).to eq :foo => "bar"
|
26
26
|
end
|
27
27
|
|
28
28
|
it "raises InvalidAction for unknown actions" do
|
@@ -37,14 +37,14 @@ describe FakeSQS::API do
|
|
37
37
|
it "resets queues" do
|
38
38
|
queues = double :queues
|
39
39
|
api = FakeSQS::API.new(:queues => queues)
|
40
|
-
queues.
|
40
|
+
expect(queues).to receive(:reset)
|
41
41
|
api.reset
|
42
42
|
end
|
43
43
|
|
44
44
|
it "expires messages in queues" do
|
45
45
|
queues = double :queues
|
46
46
|
api = FakeSQS::API.new(:queues => queues)
|
47
|
-
queues.
|
47
|
+
expect(queues).to receive(:expire)
|
48
48
|
api.expire
|
49
49
|
end
|
50
50
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'fake_sqs/catch_errors'
|
2
2
|
|
3
|
-
describe FakeSQS::CatchErrors do
|
3
|
+
RSpec.describe FakeSQS::CatchErrors do
|
4
4
|
|
5
5
|
let(:app) { double :app }
|
6
6
|
let(:error_response) { double :error_response, :status => 500, :body => "X" }
|
@@ -10,10 +10,10 @@ describe FakeSQS::CatchErrors do
|
|
10
10
|
context "when the app behaves normally" do
|
11
11
|
|
12
12
|
let(:normal_response) { double :normal_response }
|
13
|
-
before { app.
|
13
|
+
before { allow(app).to receive(:call).and_return(normal_response) }
|
14
14
|
|
15
15
|
it "doesn't modify normal responses" do
|
16
|
-
catch_errors.call({}).
|
16
|
+
expect(catch_errors.call({})).to eq normal_response
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -21,21 +21,21 @@ describe FakeSQS::CatchErrors do
|
|
21
21
|
context "when the app raises an exception" do
|
22
22
|
|
23
23
|
let(:error) { RuntimeError.new("it went wrong") }
|
24
|
-
before { app.
|
24
|
+
before { allow(app).to receive(:call).and_raise(error) }
|
25
25
|
|
26
26
|
it "cathes and processes errors" do
|
27
|
-
response.
|
27
|
+
expect(response).to receive(:new).with(error)
|
28
28
|
catch_errors.call({})
|
29
29
|
end
|
30
30
|
|
31
31
|
it "sets the status determined by the error response" do
|
32
|
-
error_response.
|
33
|
-
catch_errors.call({}).fetch(0).
|
32
|
+
allow(error_response).to receive(:status).and_return(123)
|
33
|
+
expect(catch_errors.call({}).fetch(0)).to eq 123
|
34
34
|
end
|
35
35
|
|
36
36
|
it "set the body determined by the error response" do
|
37
|
-
error_response.
|
38
|
-
catch_errors.call({}).fetch(2).
|
37
|
+
allow(error_response).to receive(:body).and_return("foobar")
|
38
|
+
expect(catch_errors.call({}).fetch(2)).to eq ["foobar"]
|
39
39
|
end
|
40
40
|
|
41
41
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'fake_sqs/collection_view'
|
2
2
|
|
3
|
-
describe FakeSQS::CollectionView do
|
3
|
+
RSpec.describe FakeSQS::CollectionView do
|
4
4
|
|
5
5
|
def wrap(collection)
|
6
6
|
FakeSQS::CollectionView.new(collection)
|
@@ -9,33 +9,33 @@ describe FakeSQS::CollectionView do
|
|
9
9
|
it 'should correctly wrap an array' do
|
10
10
|
array = %w{one two three four}
|
11
11
|
view = wrap(array)
|
12
|
-
view[0].
|
13
|
-
view[1].
|
14
|
-
view[2].
|
15
|
-
view[3].
|
12
|
+
expect(view[0]).to eq 'one'
|
13
|
+
expect(view[1]).to eq 'two'
|
14
|
+
expect(view[2]).to eq 'three'
|
15
|
+
expect(view[3]).to eq 'four'
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'should correctly wrap a hash' do
|
19
19
|
hash = { :one => 1, :two => 2, :three => 3 }
|
20
20
|
view = wrap(hash)
|
21
|
-
view[:one].
|
22
|
-
view[:two].
|
23
|
-
view[:three].
|
21
|
+
expect(view[:one]).to eq 1
|
22
|
+
expect(view[:two]).to eq 2
|
23
|
+
expect(view[:three]).to eq 3
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should respond to empty correctly' do
|
27
|
-
wrap([]).
|
28
|
-
wrap({'one' => 1}).
|
27
|
+
expect(wrap([])).to be_empty
|
28
|
+
expect(wrap({'one' => 1})).to_not be_empty
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'should be enumerable' do
|
32
32
|
result = wrap([1, 2, 3]).map { |i| i * i }
|
33
|
-
result.
|
33
|
+
expect(result).to eq [1, 4, 9]
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'should respond to size/length' do
|
37
|
-
wrap([1, 2, 3]).size.
|
38
|
-
wrap([]).
|
37
|
+
expect(wrap([1, 2, 3]).size).to eq 3
|
38
|
+
expect(wrap([]).size).to eq 0
|
39
39
|
end
|
40
40
|
|
41
|
-
end
|
41
|
+
end
|
@@ -2,7 +2,7 @@ require 'fake_sqs/error_response'
|
|
2
2
|
require 'active_support/core_ext/hash'
|
3
3
|
require 'verbose_hash_fetch'
|
4
4
|
|
5
|
-
describe FakeSQS::ErrorResponse do
|
5
|
+
RSpec.describe FakeSQS::ErrorResponse do
|
6
6
|
|
7
7
|
module FakeSQS
|
8
8
|
MissingCredentials = Class.new(RuntimeError)
|
@@ -14,13 +14,13 @@ describe FakeSQS::ErrorResponse do
|
|
14
14
|
it "picks the right error status" do
|
15
15
|
error = FakeSQS::MissingCredentials.new("message")
|
16
16
|
response = FakeSQS::ErrorResponse.new(error)
|
17
|
-
response.status.
|
17
|
+
expect(response.status).to eq 401
|
18
18
|
end
|
19
19
|
|
20
20
|
it "uses 400 as default status" do
|
21
21
|
error = ErrorUnknownToSQS.new("message")
|
22
22
|
response = FakeSQS::ErrorResponse.new(error)
|
23
|
-
response.status.
|
23
|
+
expect(response.status).to eq 500
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
@@ -32,32 +32,32 @@ describe FakeSQS::ErrorResponse do
|
|
32
32
|
let(:data) { Hash.from_xml(response.body) }
|
33
33
|
|
34
34
|
it "uses the error class name as error code" do
|
35
|
-
data.fetch("ErrorResponse").fetch("Error").fetch("Code").
|
35
|
+
expect(data.fetch("ErrorResponse").fetch("Error").fetch("Code")).to eq "MissingCredentials"
|
36
36
|
end
|
37
37
|
|
38
38
|
it "uses InternalError as code for unknown errors" do
|
39
39
|
error = ErrorUnknownToSQS.new("the message")
|
40
40
|
response = FakeSQS::ErrorResponse.new(error)
|
41
41
|
data = Hash.from_xml(response.body)
|
42
|
-
data.fetch("ErrorResponse").fetch("Error").fetch("Code").
|
42
|
+
expect(data.fetch("ErrorResponse").fetch("Error").fetch("Code")).to eq "InternalError"
|
43
43
|
end
|
44
44
|
|
45
45
|
it "uses the to_s of the error as message" do
|
46
|
-
data.fetch("ErrorResponse").fetch("Error").fetch("Message").
|
46
|
+
expect(data.fetch("ErrorResponse").fetch("Error").fetch("Message")).to eq "the message"
|
47
47
|
end
|
48
48
|
|
49
49
|
it "has a request id" do
|
50
|
-
data.fetch("ErrorResponse").fetch("RequestId").
|
50
|
+
expect(data.fetch("ErrorResponse").fetch("RequestId").size).to eq 36
|
51
51
|
end
|
52
52
|
|
53
53
|
it "uses Sender as type for 4xx responses" do
|
54
|
-
response.
|
55
|
-
data.fetch("ErrorResponse").fetch("Error").fetch("Type").
|
54
|
+
allow(response).to receive(:status).and_return(400)
|
55
|
+
expect(data.fetch("ErrorResponse").fetch("Error").fetch("Type")).to eq "Sender"
|
56
56
|
end
|
57
57
|
|
58
58
|
it "uses Receiver as type for 5xx responses" do
|
59
|
-
response.
|
60
|
-
data.fetch("ErrorResponse").fetch("Error").fetch("Type").
|
59
|
+
allow(response).to receive(:status).and_return(500)
|
60
|
+
expect(data.fetch("ErrorResponse").fetch("Error").fetch("Type")).to eq "Receiver"
|
61
61
|
end
|
62
62
|
|
63
63
|
end
|
data/spec/unit/message_spec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'fake_sqs/message'
|
2
2
|
|
3
|
-
describe FakeSQS::Message do
|
3
|
+
RSpec.describe FakeSQS::Message do
|
4
4
|
|
5
5
|
describe "#body" do
|
6
6
|
|
7
7
|
it "is extracted from the MessageBody" do
|
8
8
|
message = create_message("MessageBody" => "abc")
|
9
|
-
message.body.
|
9
|
+
expect(message.body).to eq "abc"
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|
@@ -15,7 +15,7 @@ describe FakeSQS::Message do
|
|
15
15
|
|
16
16
|
it "is calculated from body" do
|
17
17
|
message = create_message("MessageBody" => "abc")
|
18
|
-
message.md5.
|
18
|
+
expect(message.md5).to eq "900150983cd24fb0d6963f7d28e17f72"
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
@@ -24,7 +24,7 @@ describe FakeSQS::Message do
|
|
24
24
|
|
25
25
|
it "is generated" do
|
26
26
|
message = create_message
|
27
|
-
message.id.
|
27
|
+
expect(message.id.size).to eq 36
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
@@ -36,26 +36,26 @@ describe FakeSQS::Message do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should default to nil' do
|
39
|
-
message.visibility_timeout.
|
39
|
+
expect(message.visibility_timeout).to eq nil
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'should be expired when it is nil' do
|
43
|
-
message.
|
43
|
+
expect(message).to be_expired
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'should be expired if set to a previous time' do
|
47
47
|
message.visibility_timeout = Time.now - 1
|
48
|
-
message.
|
48
|
+
expect(message).to be_expired
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'should not be expired at a future date' do
|
52
52
|
message.visibility_timeout = Time.now + 1
|
53
|
-
message.
|
53
|
+
expect(message).not_to be_expired
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'should not be expired when set to expire at a future date' do
|
57
57
|
message.expire_at(5)
|
58
|
-
message.visibility_timeout.
|
58
|
+
expect(message.visibility_timeout).to be >=(Time.now + 4)
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'fake_sqs/queue_factory'
|
2
2
|
|
3
|
-
describe FakeSQS::QueueFactory do
|
3
|
+
RSpec.describe FakeSQS::QueueFactory do
|
4
4
|
|
5
5
|
it "builds queues with a message factory" do
|
6
6
|
message_factory = double :message_factory
|
7
7
|
queue = double :queue
|
8
8
|
queue_factory = FakeSQS::QueueFactory.new(message_factory: message_factory, queue: queue)
|
9
|
-
queue.
|
9
|
+
expect(queue).to receive(:new).with(message_factory: message_factory, name: "Foo")
|
10
10
|
queue_factory.new(name: "Foo")
|
11
11
|
end
|
12
12
|
|
data/spec/unit/queue_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'fake_sqs/queue'
|
2
2
|
require 'fake_sqs/message'
|
3
3
|
|
4
|
-
describe FakeSQS::Queue do
|
4
|
+
RSpec.describe FakeSQS::Queue do
|
5
5
|
|
6
6
|
class MessageFactory
|
7
7
|
def new(options = {})
|
@@ -15,20 +15,20 @@ describe FakeSQS::Queue do
|
|
15
15
|
describe "#send_message" do
|
16
16
|
|
17
17
|
it "adds a message" do
|
18
|
-
queue.
|
18
|
+
expect(queue.messages.size).to eq 0
|
19
19
|
send_message
|
20
|
-
queue.
|
20
|
+
expect(queue.messages.size).to eq 1
|
21
21
|
end
|
22
22
|
|
23
23
|
it "returns the message" do
|
24
24
|
message = double.as_null_object
|
25
|
-
message_factory.
|
26
|
-
send_message.
|
25
|
+
allow(message_factory).to receive(:new).and_return(message)
|
26
|
+
expect(send_message).to eq message
|
27
27
|
end
|
28
28
|
|
29
29
|
it "uses the message factory" do
|
30
30
|
options = { "MessageBody" => "abc" }
|
31
|
-
message_factory.
|
31
|
+
expect(message_factory).to receive(:new).with(options)
|
32
32
|
send_message(options)
|
33
33
|
end
|
34
34
|
|
@@ -39,7 +39,7 @@ describe FakeSQS::Queue do
|
|
39
39
|
it "gets the message" do
|
40
40
|
sent = send_message
|
41
41
|
received = receive_message
|
42
|
-
received.values.first.
|
42
|
+
expect(received.values.first).to eq sent
|
43
43
|
end
|
44
44
|
|
45
45
|
it "gets you a random message" do
|
@@ -60,10 +60,10 @@ describe FakeSQS::Queue do
|
|
60
60
|
reset_queue
|
61
61
|
end
|
62
62
|
|
63
|
-
(indexes[:first] + indexes[:second]).
|
63
|
+
expect(indexes[:first] + indexes[:second]).to eq sample_group
|
64
64
|
|
65
|
-
indexes[:first].
|
66
|
-
indexes[:second].
|
65
|
+
expect(indexes[:first]).to be_within(ten_percent).of(half_sample_group)
|
66
|
+
expect(indexes[:second]).to be_within(ten_percent).of(half_sample_group)
|
67
67
|
end
|
68
68
|
|
69
69
|
it "cannot get received messages" do
|
@@ -75,9 +75,9 @@ describe FakeSQS::Queue do
|
|
75
75
|
received_first = receive_message.values.first
|
76
76
|
|
77
77
|
if received_first == sent_first
|
78
|
-
receive_message.values.first.
|
78
|
+
expect(receive_message.values.first).to eq sent_second
|
79
79
|
else
|
80
|
-
receive_message.values.first.
|
80
|
+
expect(receive_message.values.first).to eq sent_first
|
81
81
|
end
|
82
82
|
reset_queue
|
83
83
|
end
|
@@ -87,23 +87,23 @@ describe FakeSQS::Queue do
|
|
87
87
|
|
88
88
|
send_message
|
89
89
|
|
90
|
-
queue.
|
91
|
-
queue.attributes["ApproximateNumberOfMessagesNotVisible"].
|
92
|
-
queue.attributes["ApproximateNumberOfMessages"].
|
90
|
+
expect(queue.messages_in_flight.size).to eq 0
|
91
|
+
expect(queue.attributes["ApproximateNumberOfMessagesNotVisible"]).to eq 0
|
92
|
+
expect(queue.attributes["ApproximateNumberOfMessages"]).to eq 1
|
93
93
|
|
94
94
|
receive_message
|
95
95
|
|
96
|
-
queue.
|
97
|
-
queue.attributes["ApproximateNumberOfMessagesNotVisible"].
|
98
|
-
queue.attributes["ApproximateNumberOfMessages"].
|
96
|
+
expect(queue.messages_in_flight.size).to eq 1
|
97
|
+
expect(queue.attributes["ApproximateNumberOfMessagesNotVisible"]).to eq 1
|
98
|
+
expect(queue.attributes["ApproximateNumberOfMessages"]).to eq 0
|
99
99
|
end
|
100
100
|
|
101
101
|
it "gets multiple message" do
|
102
102
|
sent_first = send_message
|
103
103
|
sent_second = send_message
|
104
104
|
messages = receive_message("MaxNumberOfMessages" => "2")
|
105
|
-
messages.size.
|
106
|
-
messages.values.
|
105
|
+
expect(messages.size).to eq 2
|
106
|
+
expect(messages.values).to match_array [ sent_first, sent_second ]
|
107
107
|
end
|
108
108
|
|
109
109
|
it "won't accept more than 10 message" do
|
@@ -113,7 +113,7 @@ describe FakeSQS::Queue do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it "won't error on empty queues" do
|
116
|
-
receive_message.
|
116
|
+
expect(receive_message).to eq({})
|
117
117
|
end
|
118
118
|
|
119
119
|
end
|
@@ -124,10 +124,10 @@ describe FakeSQS::Queue do
|
|
124
124
|
send_message
|
125
125
|
receipt = receive_message.keys.first
|
126
126
|
|
127
|
-
queue.
|
127
|
+
expect(queue.messages_in_flight.size).to eq 1
|
128
128
|
queue.delete_message(receipt)
|
129
|
-
queue.
|
130
|
-
queue.
|
129
|
+
expect(queue.messages_in_flight.size).to eq 0
|
130
|
+
expect(queue.messages.size).to eq 0
|
131
131
|
end
|
132
132
|
|
133
133
|
it "won't raise if the receipt is unknown" do
|
@@ -140,7 +140,7 @@ describe FakeSQS::Queue do
|
|
140
140
|
|
141
141
|
it "adds to it's queue attributes" do
|
142
142
|
queue.add_queue_attributes("foo" => "bar")
|
143
|
-
queue.attributes.
|
143
|
+
expect(queue.attributes).to eq(
|
144
144
|
"foo" => "bar",
|
145
145
|
"QueueArn" => queue.arn,
|
146
146
|
"ApproximateNumberOfMessages" => 0,
|
data/spec/unit/queues_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'fake_sqs/queues'
|
2
2
|
require 'fake_sqs/memory_database'
|
3
3
|
|
4
|
-
describe FakeSQS::Queues do
|
4
|
+
RSpec.describe FakeSQS::Queues do
|
5
5
|
|
6
6
|
let(:fake_database) { FakeSQS::MemoryDatabase.new }
|
7
7
|
let(:queue_factory) { double :queue_factory, :new => double }
|
@@ -10,21 +10,21 @@ describe FakeSQS::Queues do
|
|
10
10
|
describe "#create" do
|
11
11
|
|
12
12
|
it "creates new queues" do
|
13
|
-
queues.list.size.
|
13
|
+
expect(queues.list.size).to eq 0
|
14
14
|
create_queue("test")
|
15
|
-
queues.list.size.
|
15
|
+
expect(queues.list.size).to eq 1
|
16
16
|
end
|
17
17
|
|
18
18
|
it "uses the queue factory" do
|
19
19
|
params = double :params
|
20
|
-
queue_factory.
|
20
|
+
expect(queue_factory).to receive(:new).with(params)
|
21
21
|
create_queue("test", params)
|
22
22
|
end
|
23
23
|
|
24
24
|
it "returns the queue" do
|
25
25
|
queue = double
|
26
|
-
queue_factory.
|
27
|
-
create_queue("test").
|
26
|
+
allow(queue_factory).to receive(:new).and_return(queue)
|
27
|
+
expect(create_queue("test")).to eq queue
|
28
28
|
end
|
29
29
|
|
30
30
|
it "cannot create a queue with the same name" do
|
@@ -40,9 +40,9 @@ describe FakeSQS::Queues do
|
|
40
40
|
|
41
41
|
it "deletes an existing queue" do
|
42
42
|
create_queue("test")
|
43
|
-
queues.list.size.
|
43
|
+
expect(queues.list.size).to eq 1
|
44
44
|
queues.delete("test")
|
45
|
-
queues.list.size.
|
45
|
+
expect(queues.list.size).to eq 0
|
46
46
|
end
|
47
47
|
|
48
48
|
it "cannot delete an non-existing queue" do
|
@@ -58,14 +58,14 @@ describe FakeSQS::Queues do
|
|
58
58
|
it "returns all the queues" do
|
59
59
|
queue1 = create_queue("test-1")
|
60
60
|
queue2 = create_queue("test-2")
|
61
|
-
queues.list.
|
61
|
+
expect(queues.list).to eq [ queue1, queue2 ]
|
62
62
|
end
|
63
63
|
|
64
64
|
it "can be filtered by prefix" do
|
65
65
|
queue1 = create_queue("test-1")
|
66
66
|
queue2 = create_queue("test-2")
|
67
67
|
_ = create_queue("other-3")
|
68
|
-
queues.list("QueueNamePrefix" => "test").
|
68
|
+
expect(queues.list("QueueNamePrefix" => "test")).to eq [ queue1, queue2 ]
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
@@ -74,7 +74,7 @@ describe FakeSQS::Queues do
|
|
74
74
|
|
75
75
|
it "finds the queue by name" do
|
76
76
|
queue = create_queue("test")
|
77
|
-
queues.get("test").
|
77
|
+
expect(queues.get("test")).to eq queue
|
78
78
|
end
|
79
79
|
|
80
80
|
it "cannot get the queue if it doesn't exist" do
|
@@ -90,9 +90,9 @@ describe FakeSQS::Queues do
|
|
90
90
|
it "clears all queues" do
|
91
91
|
create_queue("foo")
|
92
92
|
create_queue("bar")
|
93
|
-
queues.list.size.
|
93
|
+
expect(queues.list.size).to eq 2
|
94
94
|
queues.reset
|
95
|
-
queues.list.size.
|
95
|
+
expect(queues.list.size).to eq 0
|
96
96
|
end
|
97
97
|
|
98
98
|
end
|
data/spec/unit/responder_spec.rb
CHANGED
@@ -2,11 +2,11 @@ require 'fake_sqs/responder'
|
|
2
2
|
require 'active_support/core_ext/hash'
|
3
3
|
require 'verbose_hash_fetch'
|
4
4
|
|
5
|
-
describe FakeSQS::Responder do
|
5
|
+
RSpec.describe FakeSQS::Responder do
|
6
6
|
|
7
7
|
it "yields xml" do
|
8
|
-
xml = subject.call :GetQueueUrl do |
|
9
|
-
|
8
|
+
xml = subject.call :GetQueueUrl do |x|
|
9
|
+
x.QueueUrl "example.com"
|
10
10
|
end
|
11
11
|
|
12
12
|
data = Hash.from_xml(xml)
|
@@ -14,7 +14,7 @@ describe FakeSQS::Responder do
|
|
14
14
|
fetch("GetQueueUrlResponse").
|
15
15
|
fetch("GetQueueUrlResult").
|
16
16
|
fetch("QueueUrl")
|
17
|
-
url.
|
17
|
+
expect(url).to eq "example.com"
|
18
18
|
end
|
19
19
|
|
20
20
|
it "skips result if no block is given" do
|
@@ -23,12 +23,12 @@ describe FakeSQS::Responder do
|
|
23
23
|
data = Hash.from_xml(xml)
|
24
24
|
|
25
25
|
response = data.fetch("DeleteQueueResponse")
|
26
|
-
response.
|
27
|
-
response.
|
26
|
+
expect(response).to have_key("ResponseMetadata")
|
27
|
+
expect(response).not_to have_key("DeleteQueueResult")
|
28
28
|
end
|
29
29
|
|
30
30
|
it "has metadata" do
|
31
|
-
xml = subject.call :GetQueueUrl do |
|
31
|
+
xml = subject.call :GetQueueUrl do |x|
|
32
32
|
end
|
33
33
|
|
34
34
|
data = Hash.from_xml(xml)
|
@@ -38,7 +38,7 @@ describe FakeSQS::Responder do
|
|
38
38
|
fetch("ResponseMetadata").
|
39
39
|
fetch("RequestId")
|
40
40
|
|
41
|
-
request_id.
|
41
|
+
expect(request_id.size).to eq 36
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'fake_sqs/show_output'
|
2
2
|
|
3
|
-
describe FakeSQS::ShowOutput do
|
3
|
+
RSpec.describe FakeSQS::ShowOutput do
|
4
4
|
|
5
5
|
after do
|
6
6
|
$stdout = STDOUT
|
@@ -11,12 +11,12 @@ describe FakeSQS::ShowOutput do
|
|
11
11
|
$stdout = StringIO.new
|
12
12
|
middleware = FakeSQS::ShowOutput.new(app)
|
13
13
|
env = {"rack.input" => ""}
|
14
|
-
app.
|
14
|
+
expect(app).to receive(:call).with(env).and_return([200, {}, ["<xml>"]])
|
15
15
|
|
16
16
|
middleware.call(env)
|
17
17
|
|
18
18
|
$stdout.rewind
|
19
|
-
$stdout.read.
|
19
|
+
expect($stdout.read).to eq "--- {}\n\n<xml>\n"
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
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.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: aws-sdk
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '2.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: faraday
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- lib/fake_sqs/web_interface.rb
|
187
187
|
- spec/acceptance/message_actions_spec.rb
|
188
188
|
- spec/acceptance/queue_actions_spec.rb
|
189
|
+
- spec/integration_spec_helper.rb
|
189
190
|
- spec/spec_helper.rb
|
190
191
|
- spec/unit/api_spec.rb
|
191
192
|
- spec/unit/catch_errors_spec.rb
|
@@ -217,13 +218,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
218
|
version: '0'
|
218
219
|
requirements: []
|
219
220
|
rubyforge_project:
|
220
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.4.5
|
221
222
|
signing_key:
|
222
223
|
specification_version: 4
|
223
224
|
summary: Provides a fake SQS server that you can run locally to test against
|
224
225
|
test_files:
|
225
226
|
- spec/acceptance/message_actions_spec.rb
|
226
227
|
- spec/acceptance/queue_actions_spec.rb
|
228
|
+
- spec/integration_spec_helper.rb
|
227
229
|
- spec/spec_helper.rb
|
228
230
|
- spec/unit/api_spec.rb
|
229
231
|
- spec/unit/catch_errors_spec.rb
|
@@ -235,3 +237,4 @@ test_files:
|
|
235
237
|
- spec/unit/queues_spec.rb
|
236
238
|
- spec/unit/responder_spec.rb
|
237
239
|
- spec/unit/show_output_spec.rb
|
240
|
+
has_rdoc:
|