waiter_ 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/version.rb +1 -1
- data/lib/waiter.rb +14 -3
- 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: 909e96c5ced33dfb6f5c9368dc7b5be54b9c9067
|
4
|
+
data.tar.gz: 6fa22187527c5683da094f72465e4d81f85863c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13fe2e2a265865e12fb97bf6c762e278ef7513354943197f90cab95237238b90eeff3fc0d3f338eb5d09501d33fdc6cdbe4ac937ae86169b7f77f3c16b7819d1
|
7
|
+
data.tar.gz: 11897bd6ce6b84025514c37005906e518c6644fe2afe25e72b11b123495f9b2c53e6db9f0179672c82d5e0f509a4009c70fbd48bff8aef604677911adeb0656e
|
data/lib/version.rb
CHANGED
data/lib/waiter.rb
CHANGED
@@ -60,7 +60,7 @@ module Waiter
|
|
60
60
|
def initialize(opts = {})
|
61
61
|
@timeout = opts[:timeout] || DEFAULT_TIMEOUT
|
62
62
|
@polling = opts[:polling] || DEFAULT_POLLING
|
63
|
-
@failure_message = opts[:failure_message] ||
|
63
|
+
@failure_message = opts[:failure_message] || default_failure_message
|
64
64
|
end
|
65
65
|
|
66
66
|
def for(value = nil, &block)
|
@@ -84,6 +84,11 @@ module Waiter
|
|
84
84
|
end
|
85
85
|
alias_method :polling_every, :every
|
86
86
|
|
87
|
+
def fail_with(message)
|
88
|
+
@failure_message = message
|
89
|
+
self
|
90
|
+
end
|
91
|
+
|
87
92
|
def to(matcher = nil, &block)
|
88
93
|
WaitExpectationTarget.new(@target).to(self, matcher, &block)
|
89
94
|
end
|
@@ -130,10 +135,16 @@ module Waiter
|
|
130
135
|
|
131
136
|
private
|
132
137
|
|
133
|
-
def
|
138
|
+
def default_failure_message
|
134
139
|
[
|
135
140
|
"Timed out after waiting for #{@timeout}s.",
|
136
|
-
"Polled for #{@polling}s."
|
141
|
+
"Polled for #{@polling}s."
|
142
|
+
].join("\n")
|
143
|
+
end
|
144
|
+
|
145
|
+
def build_error(error = nil)
|
146
|
+
[
|
147
|
+
@failure_message,
|
137
148
|
error
|
138
149
|
].join("\n")
|
139
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waiter_
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek McNeil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-expectations
|