rspec-retry-flaky 0.2.0 → 0.2.1
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 +3 -3
- data/lib/rspec/flaky/version.rb +1 -1
- data/lib/rspec/retry_flaky.rb +12 -3
- data/lib/rspec_ext/rspec_ext.rb +2 -4
- data/spec/lib/rspec/retry_flaky_spec.rb +0 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b94f1bf79fd87ca50dcc474003429df0ace7983
|
4
|
+
data.tar.gz: bae8510497ed3c3f42e67b04e82d1346f7d269d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b6d85602068e70486196f965621384ab41ff4159756ac0b4fe1609c010165c824b902ce07de3c3f64030d1b513fbd1dbc3620afc037438037eec09b7cf618a8
|
7
|
+
data.tar.gz: 12274871b996fbaf43ad90e2503243a239fb6459661cbb3ad6f611b158a7317438c3d4a9854c175b61b2cb571f7b6c1bfff9bc4b2c709e436a96222f4e9c5bde
|
data/README.md
CHANGED
@@ -51,9 +51,9 @@ It can use in Turnip.
|
|
51
51
|
```
|
52
52
|
@off_flaky_test
|
53
53
|
Feature: example
|
54
|
-
Scenario:
|
55
|
-
When
|
56
|
-
Then
|
54
|
+
Scenario: sample scenario
|
55
|
+
When example step
|
56
|
+
Then example expected
|
57
57
|
```
|
58
58
|
|
59
59
|
### progress message when the example retry
|
data/lib/rspec/flaky/version.rb
CHANGED
data/lib/rspec/retry_flaky.rb
CHANGED
@@ -10,12 +10,21 @@ module RSpec
|
|
10
10
|
conf.add_setting :flaky_retry_count, :default => 1
|
11
11
|
conf.add_setting :flaky_sleep_interval, :default => 0
|
12
12
|
|
13
|
+
# from rspec/rspec-core
|
14
|
+
# context.example is deprecated, but RSpec.current_example is not
|
15
|
+
# available until RSpec 3.0.
|
16
|
+
fetch_current_example = RSpec.respond_to?(:current_example) ?
|
17
|
+
proc { RSpec.current_example } : proc { |context| context.example }
|
18
|
+
|
13
19
|
conf.around(:example) do |example|
|
14
20
|
retry_count = RSpec.configuration.flaky_retry_count
|
15
21
|
sleep_interval = RSpec.configuration.flaky_sleep_interval
|
16
22
|
|
23
|
+
# from rspec/rspec-core
|
24
|
+
current_example = fetch_current_example.call(self)
|
25
|
+
|
17
26
|
if example.metadata[:off_flaky_test]
|
18
|
-
RSpec.configuration.reporter.message "\
|
27
|
+
RSpec.configuration.reporter.message "\n[Tag]off_flaky_test: #{current_example.location}"
|
19
28
|
retry_count = 1 # make retry_count default
|
20
29
|
end
|
21
30
|
|
@@ -25,10 +34,10 @@ module RSpec
|
|
25
34
|
RSpec.configuration.reporter.message msg
|
26
35
|
end
|
27
36
|
|
28
|
-
|
37
|
+
current_example.clear_exception
|
29
38
|
example.run
|
30
39
|
|
31
|
-
break if
|
40
|
+
break if current_example.exception.nil?
|
32
41
|
|
33
42
|
sleep sleep_interval if sleep_interval.to_i > 0
|
34
43
|
|
data/lib/rspec_ext/rspec_ext.rb
CHANGED
@@ -44,9 +44,6 @@ describe RSpec::Flaky do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
# raise error at rspec-expectations-3.1.2/lib/rspec/expectations/fail_with.rb:30:in `fail_with'
|
48
|
-
# But count and expectations are expected.
|
49
|
-
# TODO Should make stable.
|
50
47
|
context 'with retry count' do
|
51
48
|
let(:retry_count) { 3 }
|
52
49
|
before(:all) { RSpec.configure { |c| c.flaky_retry_count = 3 } }
|
@@ -59,7 +56,6 @@ describe RSpec::Flaky do
|
|
59
56
|
end
|
60
57
|
end
|
61
58
|
|
62
|
-
=begin
|
63
59
|
context do
|
64
60
|
before(:all) { set_expectations([false, false, true]) }
|
65
61
|
|
@@ -78,7 +74,6 @@ describe RSpec::Flaky do
|
|
78
74
|
expect(count).to eq 2
|
79
75
|
end
|
80
76
|
end
|
81
|
-
=end
|
82
77
|
|
83
78
|
end
|
84
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-retry-flaky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|