Not supporting RSpec 2.x anymore

This commit is contained in:
Thomas Walpole 2016-08-31 15:34:40 -07:00
parent e7c02a2a3f
commit d85bfc6825
3 changed files with 1 additions and 18 deletions

View File

@ -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
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):
```ruby

View File

@ -17,10 +17,6 @@ module Capybara
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
def wrap_matches?(actual)
@ -236,10 +232,6 @@ module Capybara
def failure_message_when_negated
"expected #{@window.inspect} not to become closed after #{@wait_time} seconds"
end
# RSpec 2 compatibility:
alias_method :failure_message_for_should, :failure_message
alias_method :failure_message_for_should_not, :failure_message_when_negated
end
# RSpec matcher for whether the element(s) matching a given selector exist

View File

@ -6,15 +6,6 @@ require "capybara/rspec" # Required here instead of in rspec_spec to avoid RSpec
require "capybara/spec/test_app"
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 SpecHelper
class << self