Class: Capybara::RSpecMatchers::Matchers::BecomeClosed
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/capybara/rspec/matchers/become_closed.rb |
Class Method Summary
- .new(options) ⇒ BecomeClosed constructor
Instance Method Summary
Constructor Details
.new(options) ⇒ BecomeClosed
# File 'lib/capybara/rspec/matchers/become_closed.rb', line 7
def initialize( ) @options = end
Instance Method Details
#failure_message
[ GitHub ]# File 'lib/capybara/rspec/matchers/become_closed.rb', line 23
def "expected #{@window.inspect} to become closed after #{@wait_time} seconds" end
#failure_message_when_negated
[ GitHub ]# File 'lib/capybara/rspec/matchers/become_closed.rb', line 27
def "expected #{@window.inspect} not to become closed after #{@wait_time} seconds" end
#matches?(window) ⇒ Boolean
# File 'lib/capybara/rspec/matchers/become_closed.rb', line 11
def matches?(window) @window = window @wait_time = Capybara::Queries::BaseQuery.wait(@options, window.session.config.default_max_wait_time) timer = Capybara::Helpers.timer(expire_in: @wait_time) while window.exists? return false if timer.expired? sleep 0.01 end true end