Class: Waiter::WaitExpectationTarget

Inherits:
RSpec::Expectations::ExpectationTarget
  • Object
show all
Defined in:
lib/waiter.rb

Instance Method Summary collapse

Instance Method Details

#not_to(waiter, matcher = nil, &block) ⇒ Object



161
162
163
164
165
166
167
168
169
170
171
# File 'lib/waiter.rb', line 161

def not_to(waiter, matcher = nil, &block)
  prevent_operator_matchers(:not_to) unless matcher
  waiter.until do
    target = handle_target(waiter.target)
    RSpec::Expectations::NegativeExpectationHandler.handle_matcher(target,
                                                                   matcher,
                                                                   &block)

    return target
  end
end

#to(waiter, matcher = nil, &block) ⇒ Object



149
150
151
152
153
154
155
156
157
158
159
# File 'lib/waiter.rb', line 149

def to(waiter, matcher = nil, &block)
  prevent_operator_matchers(:to) unless matcher
  waiter.until do
    target = handle_target(waiter.target)
    RSpec::Expectations::PositiveExpectationHandler.handle_matcher(target,
                                                                   matcher,
                                                                   &block)

    return target
  end
end