rspec-retry 0.4.2 → 0.4.3
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/README.md +5 -1
- data/changelog.md +14 -2
- data/lib/rspec/retry.rb +11 -1
- data/lib/rspec/retry/version.rb +1 -1
- data/rspec-retry.gemspec +3 -3
- data/spec/lib/rspec/retry_spec.rb +8 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a35dd5945507e2db39c8b7c9d651175d0076d61
|
4
|
+
data.tar.gz: 40fb768b1eac7619dab7febe7582b4282cefb939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b70630e8af216a0389bf087be3fef3e613a7e445b9d666f207c482c9dc4a3b3a210dbc78585c85d130de8c7629a072d10ed8c117e5be8c5ff17b06d2a4879792
|
7
|
+
data.tar.gz: 5a4aa35967e22d5b8a0f6c3919464e6a88ffa0ba4ea782be99352057153dad62c435066419054af4303d1c4799d132bcd35ebd47be825163b168963282a2ed97
|
data/README.md
CHANGED
@@ -26,7 +26,10 @@ require in ``spec_helper.rb``
|
|
26
26
|
require 'rspec/retry'
|
27
27
|
|
28
28
|
RSpec.configure do |config|
|
29
|
-
|
29
|
+
# show retry status in spec process
|
30
|
+
config.verbose_retry = true
|
31
|
+
# show exception that triggers a retry if verbose_retry is set to true
|
32
|
+
config.display_try_failure_messages = true
|
30
33
|
end
|
31
34
|
```
|
32
35
|
|
@@ -48,6 +51,7 @@ end
|
|
48
51
|
## Configuration
|
49
52
|
|
50
53
|
- __:verbose_retry__(default: *false*) Print retry status
|
54
|
+
- __:display_try_failure_messages__ (default: *false*) If verbose retry is enabled, print what reason forced the retry
|
51
55
|
- __:default_retry_count__(default: *1*) If retry count is not set in an example, this value is used by default
|
52
56
|
- __:default_sleep_interval__(default: *0*) Seconds to wait between retries
|
53
57
|
- __:clear_lets_on_failure__(default: *true*) Clear memoized values for ``let``s before retrying
|
data/changelog.md
CHANGED
@@ -1,13 +1,25 @@
|
|
1
|
+
# 0.4.3 - 2015-8-29
|
2
|
+
## bugfixes
|
3
|
+
will retry on children of exceptions in the `exceptions_to_retry` list
|
4
|
+
(thanks @dwbutler! #40, #41)
|
5
|
+
|
6
|
+
## enhancements
|
7
|
+
setting `config.display_try_failure_messages` (and `config.verbose_retry`) will
|
8
|
+
spit out some debug information about why an exception is being retried
|
9
|
+
(thanks @mmorast, #24)
|
10
|
+
|
1
11
|
# 0.4.2 - 2015-7-10
|
2
12
|
## bugfixes
|
3
13
|
setting retry to 0 will still run tests (#34)
|
4
14
|
|
5
15
|
## enhancements
|
6
|
-
can set env variable RSPEC_RETRY_RETRY_COUNT to override anything specified in
|
16
|
+
can set env variable RSPEC_RETRY_RETRY_COUNT to override anything specified in
|
17
|
+
code (thanks @sunflat, #28, #36)
|
7
18
|
|
8
19
|
# 0.4.1 - 2015-7-9
|
9
20
|
## bugfixes
|
10
21
|
rspec-retry now supports rspec 3.3. (thanks @eitoball, #32)
|
11
22
|
|
12
23
|
## dev changes
|
13
|
-
include travis configuration for testing rspec 3.2.* and 3.3.*
|
24
|
+
include travis configuration for testing rspec 3.2.* and 3.3.*
|
25
|
+
(thanks @eitoball, #31)
|
data/lib/rspec/retry.rb
CHANGED
@@ -10,6 +10,7 @@ module RSpec
|
|
10
10
|
config.add_setting :default_retry_count, :default => 1
|
11
11
|
config.add_setting :default_sleep_interval, :default => 0
|
12
12
|
config.add_setting :clear_lets_on_failure, :default => true
|
13
|
+
config.add_setting :display_try_failure_messages, :default => false
|
13
14
|
# If a list of exceptions is provided and 'retry' > 1, we only retry if
|
14
15
|
# the exception that was raised by the example is in that list. Otherwise
|
15
16
|
# we ignore the 'retry' value and fail immediately.
|
@@ -54,7 +55,16 @@ module RSpec
|
|
54
55
|
break if example.exception.nil?
|
55
56
|
|
56
57
|
if exceptions_to_retry.any?
|
57
|
-
break unless exceptions_to_retry.
|
58
|
+
break unless exceptions_to_retry.any? do |exception_klass|
|
59
|
+
example.exception.is_a?(exception_klass)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
if RSpec.configuration.verbose_retry? && RSpec.configuration.display_try_failure_messages?
|
64
|
+
if i != (retry_count-1)
|
65
|
+
try_message = "#{RSpec::Retry.ordinalize(i + 1)} Try error in #{example.location}:\n #{example.exception.to_s} \n"
|
66
|
+
RSpec.configuration.reporter.message(try_message)
|
67
|
+
end
|
58
68
|
end
|
59
69
|
|
60
70
|
self.clear_lets if clear_lets
|
data/lib/rspec/retry/version.rb
CHANGED
data/rspec-retry.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
require File.expand_path('../lib/rspec/retry/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = ["Yusuke Mito"]
|
6
|
-
gem.email = ["
|
5
|
+
gem.authors = ["Yusuke Mito", 'Michael Glass']
|
6
|
+
gem.email = ["mike@noredink.com"]
|
7
7
|
gem.description = %q{retry intermittently failing rspec examples}
|
8
8
|
gem.summary = %q{retry intermittently failing rspec examples}
|
9
|
-
gem.homepage = "http://github.com/
|
9
|
+
gem.homepage = "http://github.com/NoRedInk/rspec-retry"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -77,8 +77,15 @@ describe RSpec::Retry do
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
describe "with a list of exceptions", :retry => 2, :exceptions_to_retry => [
|
80
|
+
describe "with a list of exceptions", :retry => 2, :exceptions_to_retry => [NameError] do
|
81
81
|
context "the example throws an exception contained in the retry list" do
|
82
|
+
it "retries the maximum number of times" do
|
83
|
+
raise NameError unless count > 1
|
84
|
+
expect(count).to eq(2)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
context "the example throws a child of an exception contained in the retry list" do
|
82
89
|
it "retries the maximum number of times" do
|
83
90
|
raise NoMethodError unless count > 1
|
84
91
|
expect(count).to eq(2)
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-retry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Mito
|
8
|
+
- Michael Glass
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rspec-core
|
@@ -82,7 +83,7 @@ dependencies:
|
|
82
83
|
version: '0'
|
83
84
|
description: retry intermittently failing rspec examples
|
84
85
|
email:
|
85
|
-
-
|
86
|
+
- mike@noredink.com
|
86
87
|
executables: []
|
87
88
|
extensions: []
|
88
89
|
extra_rdoc_files: []
|
@@ -106,7 +107,7 @@ files:
|
|
106
107
|
- rspec-retry.gemspec
|
107
108
|
- spec/lib/rspec/retry_spec.rb
|
108
109
|
- spec/spec_helper.rb
|
109
|
-
homepage: http://github.com/
|
110
|
+
homepage: http://github.com/NoRedInk/rspec-retry
|
110
111
|
licenses: []
|
111
112
|
metadata: {}
|
112
113
|
post_install_message:
|