rspec-retry 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/README.md +2 -2
- data/changelog.md +10 -0
- data/gemfiles/rspec_3.3.gemfile.lock +1 -1
- data/gemfiles/rspec_3.4.gemfile.lock +1 -1
- data/gemfiles/rspec_3.5.gemfile.lock +1 -1
- data/gemfiles/rspec_3.6.gemfile.lock +1 -1
- data/gemfiles/rspec_3.7.gemfile.lock +1 -1
- data/lib/rspec/retry.rb +3 -0
- data/lib/rspec/retry/version.rb +1 -1
- data/lib/rspec_ext/rspec_ext.rb +4 -0
- data/spec/lib/rspec/retry_spec.rb +44 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c292f470d49104308ba7f48b16cd830da0f0fd1c71b116351a8abb56c617cd76
|
4
|
+
data.tar.gz: f66ea148e2be7b8a593b9966f2331090699928ea006e2e9ff1892c8d2a6e3e4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dac7014b3a66bd29265b6c3a3c6bc20f66b56737552bd0cab5cb03cf503a1e7c4c482189019c81db54b81729540a6d6388a68ddc8364f945c1ec1d845c93d3cd
|
7
|
+
data.tar.gz: 9eb09f4a99cac3929155a91f1516276351268c056b383fce0edc90173df6636c928db329d3f6a76689669195b2db0b99905ed32b6e274887697536d31df3f6d3
|
data/.travis.yml
CHANGED
@@ -2,9 +2,10 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 2.1
|
4
4
|
- 2.2
|
5
|
-
- 2.3
|
6
|
-
- 2.4
|
7
|
-
- 2.5
|
5
|
+
- 2.3
|
6
|
+
- 2.4
|
7
|
+
- 2.5
|
8
|
+
- 2.6
|
8
9
|
gemfile:
|
9
10
|
- gemfiles/rspec_3.3.gemfile
|
10
11
|
- gemfiles/rspec_3.4.gemfile
|
@@ -12,4 +13,3 @@ gemfile:
|
|
12
13
|
- gemfiles/rspec_3.6.gemfile
|
13
14
|
- gemfiles/rspec_3.7.gemfile
|
14
15
|
cache: bundler
|
15
|
-
sudo: false
|
data/README.md
CHANGED
@@ -8,8 +8,8 @@ specified number of times until the example succeeds.
|
|
8
8
|
|
9
9
|
| Rspec Version | Rspec-Retry Version |
|
10
10
|
|---------------|---------------------|
|
11
|
-
| > 3.8 | 0.6.
|
12
|
-
| > 3.3, <= 3.8 | 0.6.
|
11
|
+
| > 3.8 | 0.6.2 but untested |
|
12
|
+
| > 3.3, <= 3.8 | 0.6.2 |
|
13
13
|
| 3.2 | 0.4.6 |
|
14
14
|
| 2.14.8 | 0.4.4 |
|
15
15
|
|
data/changelog.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
# 0.6.2 - 2019-11-21
|
2
|
+
## enhancements
|
3
|
+
expose `example.attempts` (in addition to `example.metadata[:attempts]`) (thanks @knu / #103)
|
4
|
+
expose `example.metadata[:retry_exceptions]` (thanks @drummond-work / #106)
|
5
|
+
|
6
|
+
## bugfixes / cleanup
|
7
|
+
ci works again! (#107)
|
8
|
+
cleanup travis.yml (thanks @olleolleolle / #105)
|
9
|
+
|
10
|
+
|
1
11
|
# 0.6.1 - 2018-06-11
|
2
12
|
## enhancements
|
3
13
|
add more flexible method of retrying (thanks @varyform / #48)
|
data/lib/rspec/retry.rb
CHANGED
@@ -118,6 +118,7 @@ module RSpec
|
|
118
118
|
end
|
119
119
|
|
120
120
|
example.metadata[:retry_attempts] = self.attempts
|
121
|
+
example.metadata[:retry_exceptions] ||= []
|
121
122
|
|
122
123
|
example.clear_exception
|
123
124
|
ex.run
|
@@ -126,6 +127,8 @@ module RSpec
|
|
126
127
|
|
127
128
|
break if example.exception.nil?
|
128
129
|
|
130
|
+
example.metadata[:retry_exceptions] << example.exception
|
131
|
+
|
129
132
|
break if attempts >= retry_count
|
130
133
|
|
131
134
|
if exceptions_to_hard_fail.any?
|
data/lib/rspec/retry/version.rb
CHANGED
data/lib/rspec_ext/rspec_ext.rb
CHANGED
@@ -163,6 +163,19 @@ describe RSpec::Retry do
|
|
163
163
|
|
164
164
|
expect(retry_attempts).to eq(2)
|
165
165
|
end
|
166
|
+
|
167
|
+
let(:retry_exceptions) do
|
168
|
+
example_group.examples.first.metadata[:retry_exceptions]
|
169
|
+
end
|
170
|
+
|
171
|
+
it 'should add exceptions into retry_exceptions metadata array' do
|
172
|
+
example_group.example { instance_eval($example_code) }
|
173
|
+
example_group.run
|
174
|
+
|
175
|
+
expect(retry_exceptions.count).to eq(2)
|
176
|
+
expect(retry_exceptions[0].class).to eq NameError
|
177
|
+
expect(retry_exceptions[1].class).to eq NameError
|
178
|
+
end
|
166
179
|
end
|
167
180
|
|
168
181
|
context "the example throws an exception contained in the retry list" do
|
@@ -319,6 +332,37 @@ describe RSpec::Retry do
|
|
319
332
|
end
|
320
333
|
end
|
321
334
|
|
335
|
+
describe 'Example::Procsy#attempts' do
|
336
|
+
let!(:example_group) do
|
337
|
+
RSpec.describe do
|
338
|
+
before :all do
|
339
|
+
@@results = {}
|
340
|
+
end
|
341
|
+
|
342
|
+
around do |example|
|
343
|
+
example.run_with_retry
|
344
|
+
@@results[example.description] = [example.exception.nil?, example.attempts]
|
345
|
+
end
|
346
|
+
|
347
|
+
specify 'without retry option' do
|
348
|
+
expect(true).to be(true)
|
349
|
+
end
|
350
|
+
|
351
|
+
specify 'with retry option', retry: 3 do
|
352
|
+
expect(true).to be(false)
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
it 'should be exposed' do
|
358
|
+
example_group.run
|
359
|
+
expect(example_group.class_variable_get(:@@results)).to eq({
|
360
|
+
'without retry option' => [true, 1],
|
361
|
+
'with retry option' => [false, 3]
|
362
|
+
})
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
322
366
|
describe 'output in verbose mode' do
|
323
367
|
|
324
368
|
line_1 = __LINE__ + 8
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-retry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Mito
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec-core
|
@@ -133,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
|
137
|
-
rubygems_version: 2.7.6
|
136
|
+
rubygems_version: 3.0.3
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: retry intermittently failing rspec examples
|