Class: Capybara::RSpecMatchers::BecomeClosed

### Home Classes Methods

### In Files

- lib/capybara/rspec/matchers.rb

### Parent

Object

### Methods

- ::new
- #failure_message
- #failure_message_for_should
- #failure_message_for_should_not
- #failure_message_when_negated
- #matches?

### Files

- another_test_file.txt
- test_file.txt

### Class/Module Index

Quicksearch

- Capybara
- Capybara::Ambiguous
- Capybara::CapybaraError
- Capybara::DSL
- Capybara::Driver
- Capybara::Driver::Base
- Capybara::Driver::Node
- Capybara::DriverNotFoundError
- Capybara::ElementNotFound
- Capybara::ExpectationNotMet
- Capybara::Features
- Capybara::FileNotFound
- Capybara::FrozenInTime
- Capybara::Helpers
- Capybara::InfiniteRedirectError
- Capybara::ModalNotFound
- Capybara::Node
- Capybara::Node::Actions
- Capybara::Node::Base
- Capybara::Node::Document
- Capybara::Node::DocumentMatchers
- Capybara::Node::Element
- Capybara::Node::Finders
- Capybara::Node::Matchers
- Capybara::Node::Simple
- Capybara::NotSupportedByDriverError
- Capybara::Queries
- Capybara::Queries::BaseQuery
- Capybara::Queries::TextQuery
- Capybara::Queries::TitleQuery
- Capybara::Query
- Capybara::RSpecMatchers
- Capybara::RSpecMatchers::BecomeClosed
- Capybara::RSpecMatchers::HaveSelector
- Capybara::RSpecMatchers::HaveText
- Capybara::RSpecMatchers::HaveTitle
- Capybara::RSpecMatchers::Matcher
- Capybara::RackTest
- Capybara::RackTest::Browser
- Capybara::RackTest::CSSHandlers
- Capybara::RackTest::Driver
- Capybara::RackTest::Form
- Capybara::RackTest::Form::NilUploadedFile
- Capybara::RackTest::Node
- Capybara::ReadOnlyElementError
- Capybara::Result
- Capybara::ScopeError
- Capybara::Selector
- Capybara::Selector::Filter
- Capybara::Selenium
- Capybara::Selenium::Driver
- Capybara::Selenium::Node
- Capybara::Server
- Capybara::Server::Middleware
- Capybara::Session
- Capybara::SpecHelper
- Capybara::UnselectNotAllowed
- Capybara::Window
- Capybara::WindowError
- TestApp
- TestApp::TestAppError
- Object

No matching classes.

# Capybara::RSpecMatchers::BecomeClosed

### Public Class Methods

new(options) click to toggle source

    # File lib/capybara/rspec/matchers.rb, line 127
    def initialize(options)
      @wait_time = Capybara::Query.new(options).wait
    end

### Public Instance Methods

failure_message() click to toggle source

    # File lib/capybara/rspec/matchers.rb, line 141
    def failure_message
      "expected #{@window.inspect} to become closed after #{@wait_time} seconds"
    end

Also aliased as: failure_message_for_should
failure_message_for_should() click to toggle source

RSpec 2 compatibility:

Alias for: failure_message
failure_message_for_should_not() click to toggle source
Alias for: failure_message_when_negated
failure_message_when_negated() click to toggle source

    # File lib/capybara/rspec/matchers.rb, line 145
    def failure_message_when_negated
      "expected #{@window.inspect} not to become closed after #{@wait_time} seconds"
    end

Also aliased as: failure_message_for_should_not
matches?(window) click to toggle source

    # File lib/capybara/rspec/matchers.rb, line 131
    def matches?(window)
      @window = window
      start_time = Time.now
      while window.exists?
        return false if (Time.now - start_time) > @wait_time
        sleep 0.05
      end
      true
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.