take2 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/take2.rb +2 -0
- data/lib/take2/version.rb +1 -1
- data/spec/take2_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad4dbf81975a5cc73474e2423a154804f890402129dc86bd3a84f33d3bb7014e
|
4
|
+
data.tar.gz: 5db4c75eb7b03d975a6f4fcd36f92995107737e487cfa9e0ebc0b4c35683dbe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 318ddd7bc40de226b01e17d7f54106f34e41b63317ec14bd146c9df2a2cca003341c34c93929771bd13caf92d82759f9abb9d92e1d151df758877bf34eff5e01
|
7
|
+
data.tar.gz: c50474f5331470bf1ac546507a6fd13c36f70f97fe0a7e98554c73c7cc94ab18861566d1998190fa517ea8ab7d3418244c16de1a014486522fdd7f4667f68890
|
data/Gemfile.lock
CHANGED
data/lib/take2.rb
CHANGED
data/lib/take2/version.rb
CHANGED
data/spec/take2_spec.rb
CHANGED
@@ -156,6 +156,9 @@ RSpec.describe(Take2) do
|
|
156
156
|
before(:each) { @tries = 0 }
|
157
157
|
it 'responds to the method' do
|
158
158
|
expect(klass).to respond_to(:call_api_with_retry)
|
159
|
+
expect(klass).to respond_to(:with_retry)
|
160
|
+
expect(klass.method(:with_retry).original_name).to eq(klass.method(:call_api_with_retry).original_name)
|
161
|
+
expect(klass.method(:with_retry).source_location).to eq(klass.method(:call_api_with_retry).source_location)
|
159
162
|
end
|
160
163
|
it 'retries correct number of times' do
|
161
164
|
expect do
|
@@ -166,6 +169,12 @@ RSpec.describe(Take2) do
|
|
166
169
|
end
|
167
170
|
end
|
168
171
|
describe 'instance method' do
|
172
|
+
it 'responds to the method' do
|
173
|
+
expect(object).to respond_to(:call_api_with_retry)
|
174
|
+
expect(object).to respond_to(:with_retry)
|
175
|
+
expect(object.method(:with_retry).original_name).to eq(object.method(:call_api_with_retry).original_name)
|
176
|
+
expect(object.method(:with_retry).source_location).to eq(object.method(:call_api_with_retry).source_location)
|
177
|
+
end
|
169
178
|
context 'when raised with non retriable error' do
|
170
179
|
let(:error) { StandardError.new('Release the Kraken!!') }
|
171
180
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: take2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Magids
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Retry API calls, methods or blocks of code. Define take2 retry behavior
|
14
14
|
or use defaults and you good to go.
|