Class: Capybara::RSpecMatchers::BecomeClosed
- Inherits:
-
Object
- Object
- Capybara::RSpecMatchers::BecomeClosed
- Defined in:
- lib/capybara/rspec/matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(options) ⇒ BecomeClosed
constructor
A new instance of BecomeClosed.
- #matches?(window) ⇒ Boolean
Constructor Details
#initialize(options) ⇒ BecomeClosed
Returns a new instance of BecomeClosed.
233 234 235 |
# File 'lib/capybara/rspec/matchers.rb', line 233 def initialize() @options = end |
Instance Method Details
#failure_message ⇒ Object
248 249 250 |
# File 'lib/capybara/rspec/matchers.rb', line 248 def "expected #{@window.inspect} to become closed after #{@wait_time} seconds" end |
#failure_message_when_negated ⇒ Object
252 253 254 |
# File 'lib/capybara/rspec/matchers.rb', line 252 def "expected #{@window.inspect} not to become closed after #{@wait_time} seconds" end |
#matches?(window) ⇒ Boolean
237 238 239 240 241 242 243 244 245 246 |
# File 'lib/capybara/rspec/matchers.rb', line 237 def matches?(window) @window = window @wait_time = Capybara::Queries::BaseQuery.wait(@options, window.session.config.default_max_wait_time) start_time = Capybara::Helpers.monotonic_time while window.exists? return false if (Capybara::Helpers.monotonic_time - start_time) > @wait_time sleep 0.05 end true end |