mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Not supporting RSpec 2.x anymore
This commit is contained in:
parent
e7c02a2a3f
commit
d85bfc6825
3 changed files with 1 additions and 18 deletions
|
@ -138,7 +138,7 @@ There are also explicit tags for each registered driver set up for you (`@seleni
|
||||||
|
|
||||||
## <a name="using-capybara-with-rspec"></a>Using Capybara with RSpec
|
## <a name="using-capybara-with-rspec"></a>Using Capybara with RSpec
|
||||||
|
|
||||||
Load RSpec 2+ support by adding the following line (typically to your
|
Load RSpec 3.x support by adding the following line (typically to your
|
||||||
`spec_helper.rb` file):
|
`spec_helper.rb` file):
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
|
|
|
@ -17,10 +17,6 @@ module Capybara
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# RSpec 2 compatibility:
|
|
||||||
def failure_message_for_should; failure_message end
|
|
||||||
def failure_message_for_should_not; failure_message_when_negated end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def wrap_matches?(actual)
|
def wrap_matches?(actual)
|
||||||
|
@ -236,10 +232,6 @@ module Capybara
|
||||||
def failure_message_when_negated
|
def failure_message_when_negated
|
||||||
"expected #{@window.inspect} not to become closed after #{@wait_time} seconds"
|
"expected #{@window.inspect} not to become closed after #{@wait_time} seconds"
|
||||||
end
|
end
|
||||||
|
|
||||||
# RSpec 2 compatibility:
|
|
||||||
alias_method :failure_message_for_should, :failure_message
|
|
||||||
alias_method :failure_message_for_should_not, :failure_message_when_negated
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# RSpec matcher for whether the element(s) matching a given selector exist
|
# RSpec matcher for whether the element(s) matching a given selector exist
|
||||||
|
|
|
@ -6,15 +6,6 @@ require "capybara/rspec" # Required here instead of in rspec_spec to avoid RSpec
|
||||||
require "capybara/spec/test_app"
|
require "capybara/spec/test_app"
|
||||||
require "nokogiri"
|
require "nokogiri"
|
||||||
|
|
||||||
# Alias be_truthy/be_falsey if not already defined to be able to use in RSpec 2 and 3
|
|
||||||
unless RSpec::Matchers.method_defined?(:be_truthy)
|
|
||||||
RSpec::Matchers.module_eval do
|
|
||||||
alias be_truthy be_true
|
|
||||||
alias be_falsey be_false
|
|
||||||
alias be_falsy be_false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
module Capybara
|
module Capybara
|
||||||
module SpecHelper
|
module SpecHelper
|
||||||
class << self
|
class << self
|
||||||
|
|
Loading…
Add table
Reference in a new issue