rspec-retry-flaky 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/.gitignore +2 -1
- data/README.md +2 -0
- data/lib/rspec/flaky/version.rb +1 -1
- data/lib/rspec/retry_flaky.rb +2 -2
- data/spec/lib/rspec/retry_flaky_spec.rb +33 -4
- data/spec/spec_helper.rb +2 -2
- 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: a2ef6f65aef984b9e4170f6e39f628dd85b0d42d
|
4
|
+
data.tar.gz: 020d3a453b1bb1687395e570e3513a9d87597dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b35eb98b1c046a53a38b1602a90a0018433f3b8bcfdc39a82267068ec1705c325e2cc8163407bc09cd497103f709959653b5734383ad32168b184be4c1e7a3
|
7
|
+
data.tar.gz: 1a5fb06abdd705cdcb114cc6a111dd0a2cf52be84a75fa31247b430fdd87ca3f9ed2a1894ce5460be479b85f2e98f126a4d6ed4f3b6207dddab9b75daab05430
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/lib/rspec/flaky/version.rb
CHANGED
data/lib/rspec/retry_flaky.rb
CHANGED
@@ -15,8 +15,8 @@ module RSpec
|
|
15
15
|
sleep_interval = RSpec.configuration.flaky_sleep_interval
|
16
16
|
|
17
17
|
retry_count.times do |r_count|
|
18
|
-
if RSpec.configuration.
|
19
|
-
msg = "
|
18
|
+
if RSpec.configuration.verbose_retry_flaky_example && r_count > 0
|
19
|
+
msg = "\nRetry flaky #{r_count} times: #{example.location}"
|
20
20
|
RSpec.configuration.reporter.message msg
|
21
21
|
end
|
22
22
|
|
@@ -16,10 +16,6 @@ describe RSpec::Flaky do
|
|
16
16
|
@expectations = expectations
|
17
17
|
end
|
18
18
|
|
19
|
-
def shift_expectation
|
20
|
-
@expectations.shift
|
21
|
-
end
|
22
|
-
|
23
19
|
context 'no retry option' do
|
24
20
|
it 'should work' do
|
25
21
|
expect(true).to be true
|
@@ -46,4 +42,37 @@ describe RSpec::Flaky do
|
|
46
42
|
expect(RSpec.configuration.flaky_sleep_interval).to eq sleep_interval
|
47
43
|
end
|
48
44
|
end
|
45
|
+
|
46
|
+
# raise error at rspec-expectations-3.1.2/lib/rspec/expectations/fail_with.rb:30:in `fail_with'
|
47
|
+
# But count and expectations are expected.
|
48
|
+
# TODO Should make stable.
|
49
|
+
=begin
|
50
|
+
context 'with retry count' do
|
51
|
+
let!(:retry_count) { 3 }
|
52
|
+
before(:all) { RSpec.configure { |c| c.flaky_retry_count = 3 } }
|
53
|
+
before(:each) { count_up }
|
54
|
+
|
55
|
+
context do
|
56
|
+
before(:all) { set_expectations([false, false, true]) }
|
57
|
+
|
58
|
+
it "should run example until #{:retry_count} times" do
|
59
|
+
expect(true).to be @expectations[count - 1]
|
60
|
+
puts "======#{count}======="
|
61
|
+
expect(count).to eq 3
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
context do
|
67
|
+
before(:all) { set_expectations([false, true, false]) }
|
68
|
+
|
69
|
+
it "should stop example if example succeed" do
|
70
|
+
expect(true).to be @expectations[count - 1]
|
71
|
+
puts "======#{count}======="
|
72
|
+
expect(count).to eq 2
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
=end
|
77
|
+
|
49
78
|
end
|
data/spec/spec_helper.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.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-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|