rspec-wait 0.0.8 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +17 -18
- data/README.md +143 -32
- data/lib/rspec/wait/handler.rb +25 -17
- data/lib/rspec/wait/proxy.rb +15 -3
- data/lib/rspec/wait/target.rb +23 -29
- data/lib/rspec/wait/version.rb +7 -0
- data/lib/rspec/wait.rb +33 -21
- data/lib/rspec-wait.rb +3 -0
- data/rspec-wait.gemspec +30 -14
- metadata +33 -54
- data/.gitignore +0 -15
- data/.rspec +0 -4
- data/.travis.yml +0 -33
- data/CHANGELOG.md +0 -33
- data/CONTRIBUTING.md +0 -48
- data/Gemfile +0 -3
- data/Rakefile +0 -6
- data/gemfiles/rspec_2_11.gemfile +0 -9
- data/gemfiles/rspec_2_12.gemfile +0 -9
- data/gemfiles/rspec_2_13.gemfile +0 -9
- data/gemfiles/rspec_2_14.gemfile +0 -9
- data/gemfiles/rspec_3_0.gemfile +0 -9
- data/gemfiles/rspec_3_1.gemfile +0 -9
- data/gemfiles/rspec_3_2.gemfile +0 -9
- data/gemfiles/rspec_3_3.gemfile +0 -9
- data/gemfiles/rspec_3_4.gemfile +0 -9
- data/lib/rspec/wait/error.rb +0 -7
- data/spec/spec_helper.rb +0 -6
- data/spec/wait_for_spec.rb +0 -162
- data/spec/wait_spec.rb +0 -176
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-wait
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 1.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Richert
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -16,86 +16,69 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '3.5'
|
19
|
+
version: '3.4'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '3.5'
|
26
|
+
version: '3.4'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: bundler
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
31
|
+
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
33
|
+
version: '2.0'
|
40
34
|
type: :development
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
|
-
- - "
|
38
|
+
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
40
|
+
version: '2.0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: rake
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
|
-
- - "
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
47
|
+
version: '13.0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
|
-
- - "
|
52
|
+
- - ">="
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
61
|
-
description: Wait
|
62
|
-
email: steve.richert@
|
54
|
+
version: '13.0'
|
55
|
+
description: RSpec::Wait enables time-resilient expectations in your RSpec test suite.
|
56
|
+
email: steve.richert@hey.com
|
63
57
|
executables: []
|
64
58
|
extensions: []
|
65
|
-
extra_rdoc_files:
|
59
|
+
extra_rdoc_files:
|
60
|
+
- README.md
|
66
61
|
files:
|
67
|
-
- ".gitignore"
|
68
|
-
- ".rspec"
|
69
|
-
- ".travis.yml"
|
70
|
-
- CHANGELOG.md
|
71
|
-
- CONTRIBUTING.md
|
72
|
-
- Gemfile
|
73
62
|
- LICENSE.txt
|
74
63
|
- README.md
|
75
|
-
-
|
76
|
-
- gemfiles/rspec_2_11.gemfile
|
77
|
-
- gemfiles/rspec_2_12.gemfile
|
78
|
-
- gemfiles/rspec_2_13.gemfile
|
79
|
-
- gemfiles/rspec_2_14.gemfile
|
80
|
-
- gemfiles/rspec_3_0.gemfile
|
81
|
-
- gemfiles/rspec_3_1.gemfile
|
82
|
-
- gemfiles/rspec_3_2.gemfile
|
83
|
-
- gemfiles/rspec_3_3.gemfile
|
84
|
-
- gemfiles/rspec_3_4.gemfile
|
64
|
+
- lib/rspec-wait.rb
|
85
65
|
- lib/rspec/wait.rb
|
86
|
-
- lib/rspec/wait/error.rb
|
87
66
|
- lib/rspec/wait/handler.rb
|
88
67
|
- lib/rspec/wait/proxy.rb
|
89
68
|
- lib/rspec/wait/target.rb
|
69
|
+
- lib/rspec/wait/version.rb
|
90
70
|
- rspec-wait.gemspec
|
91
|
-
- spec/spec_helper.rb
|
92
|
-
- spec/wait_for_spec.rb
|
93
|
-
- spec/wait_spec.rb
|
94
71
|
homepage: https://github.com/laserlemon/rspec-wait
|
95
72
|
licenses:
|
96
73
|
- MIT
|
97
|
-
metadata:
|
98
|
-
|
74
|
+
metadata:
|
75
|
+
allowed_push_host: https://rubygems.org
|
76
|
+
bug_tracker_uri: https://github.com/laserlemon/rspec-wait/issues
|
77
|
+
funding_uri: https://github.com/sponsors/laserlemon
|
78
|
+
homepage_uri: https://github.com/laserlemon/rspec-wait
|
79
|
+
rubygems_mfa_required: 'true'
|
80
|
+
source_code_uri: https://github.com/laserlemon/rspec-wait
|
81
|
+
post_install_message:
|
99
82
|
rdoc_options: []
|
100
83
|
require_paths:
|
101
84
|
- lib
|
@@ -103,19 +86,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
86
|
requirements:
|
104
87
|
- - ">="
|
105
88
|
- !ruby/object:Gem::Version
|
106
|
-
version: '0'
|
89
|
+
version: '3.0'
|
107
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
91
|
requirements:
|
109
|
-
- - "
|
92
|
+
- - ">"
|
110
93
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
94
|
+
version: 1.3.1
|
112
95
|
requirements: []
|
113
|
-
|
114
|
-
|
115
|
-
signing_key:
|
96
|
+
rubygems_version: 3.4.10
|
97
|
+
signing_key:
|
116
98
|
specification_version: 4
|
117
99
|
summary: Wait for conditions in RSpec
|
118
|
-
test_files:
|
119
|
-
- spec/spec_helper.rb
|
120
|
-
- spec/wait_for_spec.rb
|
121
|
-
- spec/wait_spec.rb
|
100
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
before_install:
|
2
|
-
- gem update bundler rake
|
3
|
-
branches:
|
4
|
-
only:
|
5
|
-
- master
|
6
|
-
cache: bundler
|
7
|
-
env:
|
8
|
-
global:
|
9
|
-
- secure: | # CODECLIMATE_REPO_TOKEN
|
10
|
-
lK3tYDk/63jRamEfGKbC27mPAoV7XsebCurx6doeisv1r4926lyPY4B9ZoSu
|
11
|
-
OeVmjXQWHX9U7IgPH1C+zoIh1wVHVA8h5FVuqlGUMlA6IJi2xaI+ChEo3WeD
|
12
|
-
FRlk1Q5fGhgp1mt59sMn3GZZ/mv31v+sd9iYC3AVIM0KrlMGGZQ=
|
13
|
-
gemfile:
|
14
|
-
- gemfiles/rspec_2_11.gemfile
|
15
|
-
- gemfiles/rspec_2_12.gemfile
|
16
|
-
- gemfiles/rspec_2_13.gemfile
|
17
|
-
- gemfiles/rspec_2_14.gemfile
|
18
|
-
- gemfiles/rspec_3_0.gemfile
|
19
|
-
- gemfiles/rspec_3_1.gemfile
|
20
|
-
- gemfiles/rspec_3_2.gemfile
|
21
|
-
- gemfiles/rspec_3_3.gemfile
|
22
|
-
- gemfiles/rspec_3_4.gemfile
|
23
|
-
language: ruby
|
24
|
-
matrix:
|
25
|
-
allow_failures:
|
26
|
-
- rvm: ruby-head
|
27
|
-
rvm:
|
28
|
-
- 1.9.3
|
29
|
-
- "2.0"
|
30
|
-
- "2.1"
|
31
|
-
- "2.2"
|
32
|
-
- ruby-head
|
33
|
-
sudo: false
|
data/CHANGELOG.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
## 0.0.8 / 2015-11-14
|
2
|
-
|
3
|
-
* [ENHANCEMENT] Add support for RSpec 3.4
|
4
|
-
|
5
|
-
## 0.0.7 / 2015-06-16
|
6
|
-
|
7
|
-
* [ENHANCEMENT] Add support for RSpec 3.3
|
8
|
-
|
9
|
-
## 0.0.6 / 2015-06-12
|
10
|
-
|
11
|
-
* [BUGFIX] Fix the `to_not` alias in cases where the condition is not met
|
12
|
-
|
13
|
-
## 0.0.5 / 2015-01-04
|
14
|
-
|
15
|
-
* [ENHANCEMENT] Add support for RSpec 3.2
|
16
|
-
|
17
|
-
## 0.0.4 / 2014-12-18
|
18
|
-
|
19
|
-
* [FEATURE] Make RSpec::Wait's timeout and delay values configurable
|
20
|
-
* [FEATURE] Add the wait(3.seconds).for { something }.to(happen) syntax sugar
|
21
|
-
|
22
|
-
## 0.0.3 / 2014-10-29
|
23
|
-
|
24
|
-
* [ENHANCEMENT] Add support for RSpec 3.1
|
25
|
-
|
26
|
-
## 0.0.2 / 2014-06-11
|
27
|
-
|
28
|
-
* [ENHANCEMENT] Allow `wait_for` to accept either a value or block target
|
29
|
-
* [BUGFIX] Ensure blocks are re-evaluated with each iteration
|
30
|
-
|
31
|
-
## 0.0.1 / 2014-04-19
|
32
|
-
|
33
|
-
* Initial release!
|
data/CONTRIBUTING.md
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# Contributing to RSpec::Wait
|
2
|
-
|
3
|
-
RSpec::Wait is open source and contributions from the community are encouraged!
|
4
|
-
No contribution is too small.
|
5
|
-
|
6
|
-
Please consider:
|
7
|
-
|
8
|
-
* Adding a feature
|
9
|
-
* Squashing a bug
|
10
|
-
* Writing documentation
|
11
|
-
* Fixing a typo
|
12
|
-
* Correcting [style](https://github.com/styleguide/ruby)
|
13
|
-
|
14
|
-
## How do I contribute?
|
15
|
-
|
16
|
-
For the best chance of having your changes merged, please:
|
17
|
-
|
18
|
-
1. [Fork](https://github.com/laserlemon/rspec-wait/fork) the project.
|
19
|
-
2. [Write](http://en.wikipedia.org/wiki/Test-driven_development) a failing test.
|
20
|
-
3. [Commit](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) changes that fix the tests.
|
21
|
-
4. [Submit](https://github.com/laserlemon/rspec-wait/pulls) a pull request with *at least* one animated GIF.
|
22
|
-
5. Be patient.
|
23
|
-
|
24
|
-
If your proposed changes only affect documentation, include the following on a
|
25
|
-
new line in each of your commit messages:
|
26
|
-
|
27
|
-
```
|
28
|
-
[ci skip]
|
29
|
-
```
|
30
|
-
|
31
|
-
This will signal [Travis](https://travis-ci.org) that running the test suite is
|
32
|
-
not necessary for these changes.
|
33
|
-
|
34
|
-
## Bug Reports
|
35
|
-
|
36
|
-
If you are experiencing unexpected behavior and, after having read RSpec::Wait's
|
37
|
-
documentation, are convinced this behavior is a bug, please:
|
38
|
-
|
39
|
-
1. [Search](https://github.com/laserlemon/rspec-wait/issues) existing issues.
|
40
|
-
2. Collect enough information to reproduce the issue:
|
41
|
-
* RSpec::Wait version
|
42
|
-
* Ruby version
|
43
|
-
* RSpec version
|
44
|
-
* Specific setup conditions
|
45
|
-
* Description of expected behavior
|
46
|
-
* Description of actual behavior
|
47
|
-
3. [Submit](https://github.com/laserlemon/rspec-wait/issues/new) an issue.
|
48
|
-
4. Be patient.
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/gemfiles/rspec_2_11.gemfile
DELETED
data/gemfiles/rspec_2_12.gemfile
DELETED
data/gemfiles/rspec_2_13.gemfile
DELETED
data/gemfiles/rspec_2_14.gemfile
DELETED
data/gemfiles/rspec_3_0.gemfile
DELETED
data/gemfiles/rspec_3_1.gemfile
DELETED
data/gemfiles/rspec_3_2.gemfile
DELETED
data/gemfiles/rspec_3_3.gemfile
DELETED
data/gemfiles/rspec_3_4.gemfile
DELETED
data/lib/rspec/wait/error.rb
DELETED
data/spec/spec_helper.rb
DELETED
data/spec/wait_for_spec.rb
DELETED
@@ -1,162 +0,0 @@
|
|
1
|
-
describe "wait_for" do
|
2
|
-
let!(:progress) { "" }
|
3
|
-
|
4
|
-
before do
|
5
|
-
Thread.new do
|
6
|
-
2.times do
|
7
|
-
sleep 1
|
8
|
-
progress << "."
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context "to" do
|
14
|
-
it "passes immediately" do
|
15
|
-
expect {
|
16
|
-
wait_for { progress }.to eq("")
|
17
|
-
}.not_to raise_error
|
18
|
-
end
|
19
|
-
|
20
|
-
it "waits for the matcher to pass" do
|
21
|
-
expect {
|
22
|
-
wait_for { progress }.to eq(".")
|
23
|
-
}.not_to raise_error
|
24
|
-
end
|
25
|
-
|
26
|
-
it "re-evaluates the actual value" do
|
27
|
-
expect {
|
28
|
-
wait_for { progress.dup }.to eq(".")
|
29
|
-
}.not_to raise_error
|
30
|
-
end
|
31
|
-
|
32
|
-
it "fails if the matcher never passes" do
|
33
|
-
expect {
|
34
|
-
wait_for { progress }.to eq("...")
|
35
|
-
}.to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
36
|
-
end
|
37
|
-
|
38
|
-
it "times out if the block never finishes" do
|
39
|
-
expect {
|
40
|
-
wait_for { sleep 11; progress }.to eq("..")
|
41
|
-
}.to raise_error(RSpec::Wait::TimeoutError)
|
42
|
-
end
|
43
|
-
|
44
|
-
it "respects a timeout specified in configuration" do
|
45
|
-
original_timeout = RSpec.configuration.wait_timeout
|
46
|
-
RSpec.configuration.wait_timeout = 3
|
47
|
-
|
48
|
-
begin
|
49
|
-
expect {
|
50
|
-
wait_for { sleep 4; progress }.to eq("..")
|
51
|
-
}.to raise_error(RSpec::Wait::TimeoutError)
|
52
|
-
ensure
|
53
|
-
RSpec.configuration.wait_timeout = original_timeout
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
it "respects a timeout specified in options", wait: { timeout: 3 } do
|
58
|
-
expect {
|
59
|
-
wait_for { sleep 4; progress }.to eq("..")
|
60
|
-
}.to raise_error(RSpec::Wait::TimeoutError)
|
61
|
-
end
|
62
|
-
|
63
|
-
it "raises an error occuring in the block" do
|
64
|
-
expect {
|
65
|
-
wait_for { raise RuntimeError }.to eq("..")
|
66
|
-
}.to raise_error(RuntimeError)
|
67
|
-
end
|
68
|
-
|
69
|
-
it "prevents operator matchers" do
|
70
|
-
expect {
|
71
|
-
wait_for { progress }.to == "."
|
72
|
-
}.to raise_error(ArgumentError)
|
73
|
-
end
|
74
|
-
|
75
|
-
it "accepts a value rather than a block" do
|
76
|
-
expect {
|
77
|
-
wait_for(progress).to eq(".")
|
78
|
-
}.not_to raise_error
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
context "not_to" do
|
83
|
-
it "passes immediately" do
|
84
|
-
expect {
|
85
|
-
wait_for { progress }.not_to eq("..")
|
86
|
-
}.not_to raise_error
|
87
|
-
end
|
88
|
-
|
89
|
-
it "waits for the matcher not to pass" do
|
90
|
-
expect {
|
91
|
-
wait_for { progress }.not_to eq("")
|
92
|
-
}.not_to raise_error
|
93
|
-
end
|
94
|
-
|
95
|
-
it "re-evaluates the actual value" do
|
96
|
-
expect {
|
97
|
-
wait_for { progress.dup }.not_to eq("")
|
98
|
-
}.not_to raise_error
|
99
|
-
end
|
100
|
-
|
101
|
-
it "fails if the matcher always passes" do
|
102
|
-
expect {
|
103
|
-
wait_for { progress }.not_to be_a(String)
|
104
|
-
}.to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
105
|
-
end
|
106
|
-
|
107
|
-
it "times out if the block never finishes" do
|
108
|
-
expect {
|
109
|
-
wait_for { sleep 11; progress }.not_to eq("..")
|
110
|
-
}.to raise_error(RSpec::Wait::TimeoutError)
|
111
|
-
end
|
112
|
-
|
113
|
-
it "respects a timeout specified in configuration" do
|
114
|
-
original_timeout = RSpec.configuration.wait_timeout
|
115
|
-
RSpec.configuration.wait_timeout = 3
|
116
|
-
|
117
|
-
begin
|
118
|
-
expect {
|
119
|
-
wait_for { sleep 4; progress }.not_to eq("..")
|
120
|
-
}.to raise_error(RSpec::Wait::TimeoutError)
|
121
|
-
ensure
|
122
|
-
RSpec.configuration.wait_timeout = original_timeout
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
it "respects a timeout specified in options", wait: { timeout: 3 } do
|
127
|
-
expect {
|
128
|
-
wait_for { sleep 4; progress }.not_to eq("..")
|
129
|
-
}.to raise_error(RSpec::Wait::TimeoutError)
|
130
|
-
end
|
131
|
-
|
132
|
-
it "raises an error occuring in the block" do
|
133
|
-
expect {
|
134
|
-
wait_for { raise RuntimeError }.not_to eq("")
|
135
|
-
}.to raise_error(RuntimeError)
|
136
|
-
end
|
137
|
-
|
138
|
-
it "respects the to_not alias when expectation is met" do
|
139
|
-
expect {
|
140
|
-
wait_for { true }.to_not eq(false)
|
141
|
-
}.not_to raise_error
|
142
|
-
end
|
143
|
-
|
144
|
-
it "respects the to_not alias when expectation is not met" do
|
145
|
-
expect {
|
146
|
-
wait_for { true }.to_not eq(true)
|
147
|
-
}.to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
148
|
-
end
|
149
|
-
|
150
|
-
it "prevents operator matchers" do
|
151
|
-
expect {
|
152
|
-
wait_for { progress }.not_to == ".."
|
153
|
-
}.to raise_error(ArgumentError)
|
154
|
-
end
|
155
|
-
|
156
|
-
it "accepts a value rather than a block" do
|
157
|
-
expect {
|
158
|
-
wait_for(progress).not_to eq("..")
|
159
|
-
}.not_to raise_error
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|