From d85bfc682539a0846010a5fdedc89f266d34f58a Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Wed, 31 Aug 2016 15:34:40 -0700 Subject: [PATCH] Not supporting RSpec 2.x anymore --- README.md | 2 +- lib/capybara/rspec/matchers.rb | 8 -------- lib/capybara/spec/spec_helper.rb | 9 --------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/README.md b/README.md index e69f0c10..f59144b5 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ There are also explicit tags for each registered driver set up for you (`@seleni ## 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 diff --git a/lib/capybara/rspec/matchers.rb b/lib/capybara/rspec/matchers.rb index 180e08d0..bcac428e 100644 --- a/lib/capybara/rspec/matchers.rb +++ b/lib/capybara/rspec/matchers.rb @@ -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 diff --git a/lib/capybara/spec/spec_helper.rb b/lib/capybara/spec/spec_helper.rb index a5b2ce5c..86193194 100644 --- a/lib/capybara/spec/spec_helper.rb +++ b/lib/capybara/spec/spec_helper.rb @@ -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