Skip to content

Commit ade170e

Browse files
committed
lint
1 parent c3e337a commit ade170e

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

spec/models/google_play_store_integration_spec.rb

+20-22
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
end
3030

3131
it "returns successful result if there are allowed exceptions" do
32-
error_body = { "error" => { "status" => "PERMISSION_DENIED", "code" => 403, "message" => "APK specifies a version code that has already been used" } }
32+
error_body = {"error" => {"status" => "PERMISSION_DENIED", "code" => 403, "message" => "APK specifies a version code that has already been used"}}
3333
error = ::Google::Apis::ClientError.new("Error", body: error_body.to_json)
3434
allow(api_double).to receive(:upload).and_raise(Installations::Google::PlayDeveloper::Error.new(error))
3535

@@ -38,7 +38,7 @@
3838
end
3939

4040
it "retries if there are retryable exceptions" do
41-
error_body = { "error" => { "status" => "FAILED_PRECONDITION", "code" => 400, "message" => "This Edit has been deleted" } }
41+
error_body = {"error" => {"status" => "FAILED_PRECONDITION", "code" => 400, "message" => "This Edit has been deleted"}}
4242
error = Google::Apis::ClientError.new("Error", body: error_body.to_json)
4343
allow(api_double).to receive(:upload).and_raise(Installations::Google::PlayDeveloper::Error.new(error))
4444

@@ -47,7 +47,7 @@
4747
end
4848

4949
it "returns failed result if there are disallowed exceptions" do
50-
error_body = { "error" => { "status" => "NOT_FOUND", "code" => 404, "message" => "Package not found:" } }
50+
error_body = {"error" => {"status" => "NOT_FOUND", "code" => 404, "message" => "Package not found:"}}
5151
error = ::Google::Apis::ClientError.new("Error", body: error_body.to_json)
5252
allow(api_double).to receive(:upload).and_raise(Installations::Google::PlayDeveloper::Error.new(error))
5353

@@ -166,7 +166,7 @@
166166
name: :track,
167167
releases: [
168168
{
169-
localizations: [{ release_notes: { language: "en-US", text: "text" } }],
169+
localizations: [{release_notes: {language: "en-US", text: "text"}}],
170170
version_string: "1.0.0",
171171
status: "inProgress",
172172
user_fraction: 0.99,
@@ -180,7 +180,7 @@
180180
name: :track,
181181
releases: [
182182
{
183-
localizations: [{ release_notes: { language: "en-US", text: "text" } }],
183+
localizations: [{release_notes: {language: "en-US", text: "text"}}],
184184
version_string: "1.0.0",
185185
status: "completed",
186186
user_fraction: 1.0,
@@ -244,23 +244,21 @@
244244
end
245245

246246
it "allows the retries to drain out if the lock could not be acquired on time" do
247-
begin
248-
# pre-acquire lock elsewhere
249-
allow(api_double).to receive(:halt_release) { sleep 10 }
250-
Thread.new { google_integration.halt_release(anything, anything, anything, anything) }
251-
sleep 1
252-
253-
allow(google_integration).to receive(:api_lock_params).and_return(retry_count: 1, retry_delay: 1)
254-
allow(api_double).to receive(:create_release)
255-
256-
# queue new request that cannot acquire the lock
257-
r = google_integration.rollout_release(anything, anything, anything, anything, anything)
258-
expect(r.ok?).to be false
259-
puts r.error.backtrace
260-
expect(r.error.reason).to eq(GooglePlayStoreIntegration::LOCK_ACQUISITION_FAILURE_REASON)
261-
rescue => e
262-
puts e.backtrace
263-
end
247+
# pre-acquire lock elsewhere
248+
allow(api_double).to receive(:halt_release) { sleep 10 }
249+
Thread.new { google_integration.halt_release(anything, anything, anything, anything) }
250+
sleep 1
251+
252+
allow(google_integration).to receive(:api_lock_params).and_return(retry_count: 1, retry_delay: 1)
253+
allow(api_double).to receive(:create_release)
254+
255+
# queue new request that cannot acquire the lock
256+
r = google_integration.rollout_release(anything, anything, anything, anything, anything)
257+
expect(r.ok?).to be false
258+
puts r.error.backtrace
259+
expect(r.error.reason).to eq(GooglePlayStoreIntegration::LOCK_ACQUISITION_FAILURE_REASON)
260+
rescue => e
261+
puts e.backtrace
264262
end
265263
end
266264
end

0 commit comments

Comments
 (0)