Class: RSpec::Wait::Target
- Inherits:
-
Expectations::ExpectationTarget
- Object
- Expectations::ExpectationTarget
- RSpec::Wait::Target
- Defined in:
- lib/rspec/wait/target.rb
Overview
The RSpec::Wait::Target class inherits from RSpec’s internal RSpec::Expectations::ExpectationTarget class and allows the inclusion of RSpec::Wait options via RSpec::Wait::Proxy.
Instance Method Summary collapse
- #initialize(block, options = {}) ⇒ Target constructor
- #not_to(matcher = nil, message = nil, &block) ⇒ Object (also: #to_not)
- #to(matcher = nil, message = nil, &block) ⇒ Object
Constructor Details
#initialize(block, options = {}) ⇒ Target
10 11 12 13 |
# File 'lib/rspec/wait/target.rb', line 10 def initialize(block, = {}) @wait_options = super(block) end |
Instance Method Details
#not_to(matcher = nil, message = nil, &block) ⇒ Object Also known as: to_not
25 26 27 28 29 30 31 |
# File 'lib/rspec/wait/target.rb', line 25 def not_to(matcher = nil, = nil, &block) prevent_operator_matchers(:not_to) unless matcher with_wait do NegativeHandler.handle_matcher(@target, matcher, , &block) end end |
#to(matcher = nil, message = nil, &block) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rspec/wait/target.rb', line 16 def to(matcher = nil, = nil, &block) prevent_operator_matchers(:to) unless matcher with_wait do PositiveHandler.handle_matcher(@target, matcher, , &block) end end |