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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2b9d1165c2bbc7d0e0e59b161ef35e9d72586f8498738312bf72ebf5e5b2f31
4
- data.tar.gz: 1b4d00168ff6b2cdc14be86fcf65b05e0ff919ca4e61535e76cdd3fac0006680
3
+ metadata.gz: ad4dbf81975a5cc73474e2423a154804f890402129dc86bd3a84f33d3bb7014e
4
+ data.tar.gz: 5db4c75eb7b03d975a6f4fcd36f92995107737e487cfa9e0ebc0b4c35683dbe9
5
5
  SHA512:
6
- metadata.gz: 8f01b351dd0a3640fd09d7fe00b515543bbbfaf9ec1abb60bbf2b962e20b32490edb06cab51b81ee65383864e90f92e54533639a1bed1eaae1ed24afe599e378
7
- data.tar.gz: 853ffe970c1c08306ff42966d7946ed92445e7d6b999801eeedf9ff2eae4f0ef12e321ff9ab75a2ce22d9514af5797d497c9f090dfee4aa4be7e7a7809911e64
6
+ metadata.gz: 318ddd7bc40de226b01e17d7f54106f34e41b63317ec14bd146c9df2a2cca003341c34c93929771bd13caf92d82759f9abb9d92e1d151df758877bf34eff5e01
7
+ data.tar.gz: c50474f5331470bf1ac546507a6fd13c36f70f97fe0a7e98554c73c7cc94ab18861566d1998190fa517ea8ab7d3418244c16de1a014486522fdd7f4667f68890
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- take2 (0.1.0)
4
+ take2 (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -83,6 +83,8 @@ module Take2
83
83
  end
84
84
  end
85
85
 
86
+ alias_method :with_retry, :call_api_with_retry
87
+
86
88
  # Sets number of retries.
87
89
  #
88
90
  # Example:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Take2
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -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.0
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-07-28 00:00:00.000000000 Z
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.