test-helpers 2.0.0 → 2.0.5
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/lib/test-helpers/version.rb +3 -0
- data/lib/test-helpers/wait.rb +2 -1
- data/lib/test-helpers/wait/wait.rb +15 -9
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43d35aa1ffa08a2e38cf00e413a6c7782f441d14
|
4
|
+
data.tar.gz: c7abe664c22040291cbca06f5cc96e6bdbf8cbb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce38e8648ae9be2e79ceece742585deb2732a97a4fb9da44cd6aeac05bc87c8fb948a6a471067bde2dceecb2868c7082fac1fabc2b29f7b4f7595f83b26aacd8
|
7
|
+
data.tar.gz: 4927220ca6ea3f784b4a091d26c2cc57aa75f0a0aa47c6c264b57b8bf3971da589ee8be6094469ca5a795f90b84cdcc0c7525c0c76808060097cdbcf64a47598
|
data/lib/test-helpers/wait.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
module TestHelpers
|
2
2
|
module Wait
|
3
|
-
|
4
|
-
|
3
|
+
def self.configuration
|
4
|
+
default_configuration
|
5
5
|
end
|
6
6
|
|
7
|
-
def self.
|
7
|
+
def self.default_configuration
|
8
8
|
@configuration ||= Configuration.new
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.configure
|
12
|
-
yield(
|
12
|
+
yield(default_configuration) if block_given?
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
extend ::Gem::Deprecate
|
17
|
+
deprecate :configuration, :default_configuration, 2017, 04
|
13
18
|
end
|
14
19
|
|
15
20
|
class Configuration
|
@@ -24,8 +29,8 @@ module TestHelpers
|
|
24
29
|
|
25
30
|
def poll_and_assert(options = {})
|
26
31
|
return unless block_given?
|
27
|
-
timeout = Float(options[:timeout] || TestHelpers::Wait.
|
28
|
-
interval = Float(options[:interval] || TestHelpers::Wait.
|
32
|
+
timeout = Float(options[:timeout] || TestHelpers::Wait.default_configuration.wait_timeout)
|
33
|
+
interval = Float(options[:interval] || TestHelpers::Wait.default_configuration.wait_interval)
|
29
34
|
end_time = ::Time.now + timeout
|
30
35
|
failure = nil
|
31
36
|
until ::Time.now > end_time
|
@@ -42,14 +47,15 @@ module TestHelpers
|
|
42
47
|
|
43
48
|
def wait_until(options = {})
|
44
49
|
return unless block_given?
|
45
|
-
timeout = Float(options[:timeout] || TestHelpers::Wait.
|
46
|
-
interval = Float(options[:interval] || TestHelpers::Wait.
|
47
|
-
error_message = options[:error_message] || TestHelpers::Wait.
|
50
|
+
timeout = Float(options[:timeout] || TestHelpers::Wait.default_configuration.wait_timeout)
|
51
|
+
interval = Float(options[:interval] || TestHelpers::Wait.default_configuration.wait_interval)
|
52
|
+
error_message = options[:error_message] || TestHelpers::Wait.default_configuration.error_message
|
48
53
|
end_time = ::Time.now + timeout
|
49
54
|
until ::Time.now > end_time
|
50
55
|
begin
|
51
56
|
result = yield
|
52
57
|
return result if result
|
58
|
+
sleep interval
|
53
59
|
rescue ::StandardError
|
54
60
|
sleep interval
|
55
61
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umair Chagani, Manheim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: A collection of helpers.
|
@@ -46,6 +46,7 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- lib/test-helpers/all.rb
|
48
48
|
- lib/test-helpers/test-helpers.rb
|
49
|
+
- lib/test-helpers/version.rb
|
49
50
|
- lib/test-helpers/wait.rb
|
50
51
|
- lib/test-helpers/wait/wait.rb
|
51
52
|
homepage: http://github.com/manheim/test-helpers
|
@@ -58,17 +59,17 @@ require_paths:
|
|
58
59
|
- lib
|
59
60
|
required_ruby_version: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
|
-
- -
|
62
|
+
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
64
|
version: 2.3.0
|
64
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- -
|
67
|
+
- - ">="
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
requirements: []
|
70
71
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.
|
72
|
+
rubygems_version: 2.6.8
|
72
73
|
signing_key:
|
73
74
|
specification_version: 4
|
74
75
|
summary: Test helpers!
|