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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 752d08bab491a9aaa4c65102dfe84f88efa0bb47
4
- data.tar.gz: dbd5d1b12aaff3dc15093416303be9663ad55b30
3
+ metadata.gz: a2ef6f65aef984b9e4170f6e39f628dd85b0d42d
4
+ data.tar.gz: 020d3a453b1bb1687395e570e3513a9d87597dc7
5
5
  SHA512:
6
- metadata.gz: c009262cf633398bed28dd994cc0f02c6aa36cca8671f30df7533acf3e48e2b890f0d7014346a963803f8de9b9ddb30201f866d38cffbd5b766afca791a86c0b
7
- data.tar.gz: 105ee545d660e2fcffc5d028647e9d2dadd686d0d3495def7e3b8b290923132190e37bad978f41cff166e4ff8d5974d6b9c576f4ec4b1923ec26389da1a7ec38
6
+ metadata.gz: 75b35eb98b1c046a53a38b1602a90a0018433f3b8bcfdc39a82267068ec1705c325e2cc8163407bc09cd497103f709959653b5734383ad32168b184be4c1e7a3
7
+ data.tar.gz: 1a5fb06abdd705cdcb114cc6a111dd0a2cf52be84a75fa31247b430fdd87ca3f9ed2a1894ce5460be479b85f2e98f126a4d6ed4f3b6207dddab9b75daab05430
data/.gitignore CHANGED
@@ -12,4 +12,5 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
- .idea
15
+ .idea
16
+ *.gem
data/README.md CHANGED
@@ -28,6 +28,8 @@ RSpec.configure do |c|
28
28
  end
29
29
  ```
30
30
 
31
+ This feature use ```RSpec.configure.around(:example) { |example| something }``` hook.
32
+
31
33
  ## Usage
32
34
 
33
35
  ### progress message when the example retry
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  class Flaky
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -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.verbose_retry_flack_example && r_count > 0
19
- msg = "Retry flaky #{r_count} times: #{example.location}"
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
@@ -1,6 +1,6 @@
1
1
  require 'rspec'
2
- require 'rspec/retry_flaky'
2
+ require_relative '../lib/rspec/retry_flaky'
3
3
 
4
4
  RSpec.configure do |c|
5
- c.verbose_retry_flack_example = true
5
+ c.verbose_retry_flaky_example = true
6
6
  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.1.0
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-02-28 00:00:00.000000000 Z
11
+ date: 2015-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec