test-helpers 2.0.0 → 2.0.5

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: 349ef457c70b32d2c27ca8bf98ed390a8d627b62
4
- data.tar.gz: 8c3ba44388d9fa532bc64d473257b50ae27c9bf7
3
+ metadata.gz: 43d35aa1ffa08a2e38cf00e413a6c7782f441d14
4
+ data.tar.gz: c7abe664c22040291cbca06f5cc96e6bdbf8cbb5
5
5
  SHA512:
6
- metadata.gz: 4270e52db38ac2453422e25c904510f695d09de8e5f9a34c348d183a55e0c155d1bd28c8d8732c3958d898bf82462f5c61bde86fda3e32fdef080ce1e67679ba
7
- data.tar.gz: 3c240a37e9054857aa5c8e89220a92d7dbc7b96f3b30461e3837e17b1f400f103baffafd72a3a194cccd0ab9a41feb19bf87efcd9891da0b70c06e947652dc1d
6
+ metadata.gz: ce38e8648ae9be2e79ceece742585deb2732a97a4fb9da44cd6aeac05bc87c8fb948a6a471067bde2dceecb2868c7082fac1fabc2b29f7b4f7595f83b26aacd8
7
+ data.tar.gz: 4927220ca6ea3f784b4a091d26c2cc57aa75f0a0aa47c6c264b57b8bf3971da589ee8be6094469ca5a795f90b84cdcc0c7525c0c76808060097cdbcf64a47598
@@ -0,0 +1,3 @@
1
+ module TestHelpers
2
+ VERSION = '2.0.5'
3
+ end
@@ -1,2 +1,3 @@
1
1
  require 'test-helpers/test-helpers'
2
- require 'test-helpers/wait/wait'
2
+ require 'test-helpers/wait/wait'
3
+ require 'timeout'
@@ -1,15 +1,20 @@
1
1
  module TestHelpers
2
2
  module Wait
3
- class << self
4
- attr_accessor :configuration
3
+ def self.configuration
4
+ default_configuration
5
5
  end
6
6
 
7
- def self.configuration
7
+ def self.default_configuration
8
8
  @configuration ||= Configuration.new
9
9
  end
10
10
 
11
11
  def self.configure
12
- yield(configuration) if block_given?
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.configuration.wait_timeout)
28
- interval = Float(options[:interval] || TestHelpers::Wait.configuration.wait_interval)
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.configuration.wait_timeout)
46
- interval = Float(options[:interval] || TestHelpers::Wait.configuration.wait_interval)
47
- error_message = options[:error_message] || TestHelpers::Wait.configuration.error_message
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.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: 2015-08-25 00:00:00.000000000 Z
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.4.8
72
+ rubygems_version: 2.6.8
72
73
  signing_key:
73
74
  specification_version: 4
74
75
  summary: Test helpers!