Skip to content

Commit

Permalink
Drop support for RSpec 2
Browse files Browse the repository at this point in the history
  • Loading branch information
maurogeorge authored and mcmire committed Sep 22, 2015
1 parent 2af1004 commit 32c0e62
Show file tree
Hide file tree
Showing 25 changed files with 2 additions and 59 deletions.
5 changes: 1 addition & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
### Backward-incompatible changes

* We've dropped support for Rails 3.x, Ruby 1.9.2, and Ruby 1.9.3, and RSpec 2.
All of these things have been end-of-lifed. This doesn't mean that the gem
will stop working immediately, but we won't accept any pull requests to fix
any compatibility issues, so you're encouraged to upgrade.
([a4045a1], [b7fe87a])
All of these have been end-of-lifed. ([a4045a1], [b7fe87a])

* The gem no longer detects the test framework you're using or mixes itself into
that framework automatically. [History][no-auto-integration-1] has
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/action_controller/callback_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,10 @@ def matches?(controller)
def failure_message
"Expected that #{controller_class.name} would have :#{method_name} as a #{kind}_#{callback_type}"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Expected that #{controller_class.name} would not have :#{method_name} as a #{kind}_#{callback_type}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
"have :#{method_name} as a #{kind}_#{callback_type}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ def matches?(controller)
def failure_message
"Expected #{@key} to be filtered; filtered keys: #{filtered_keys.join(', ')}"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{@key} to be filtered"
end
alias failure_message_for_should_not failure_message_when_negated

def description
"filter #{@key}"
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/action_controller/permit_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,10 @@ def matches?(controller)
def failure_message
"Expected #{verb.upcase} ##{action} to #{expectation},\nbut #{reality}."
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Expected #{verb.upcase} ##{action} not to #{expectation},\nbut it did."
end
alias failure_message_for_should_not failure_message_when_negated

protected

Expand Down
3 changes: 0 additions & 3 deletions lib/shoulda/matchers/action_controller/redirect_to_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def redirect_to(url_or_description, &block)
class RedirectToMatcher
attr_reader :failure_message, :failure_message_when_negated

alias failure_message_for_should failure_message
alias failure_message_for_should_not failure_message_when_negated

def initialize(url_or_description, context, &block)
@url_block = nil
@url = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module ActionController
# end
# end
#
#
#
#
# @return [RenderTemplateMatcher]
#
Expand All @@ -46,9 +46,6 @@ def render_template(options = {}, message = nil)
class RenderTemplateMatcher
attr_reader :failure_message, :failure_message_when_negated

alias failure_message_for_should failure_message
alias failure_message_for_should_not failure_message_when_negated

def initialize(options, message, context)
@options = options
@message = message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ def matches?(controller)
def failure_message
"Expected #{expectation}, but #{result}"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}, but #{result}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
description = 'render with '
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/action_controller/rescue_from_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ def description
def failure_message
"Expected #{expectation}"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

protected

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ def matches?(controller)
def failure_message
"Expected #{expectation}"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
"respond with #{@status}"
Expand Down
3 changes: 0 additions & 3 deletions lib/shoulda/matchers/action_controller/route_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ def initialize(method, path, context)

attr_reader :failure_message, :failure_message_when_negated

alias failure_message_for_should failure_message
alias failure_message_for_should_not failure_message_when_negated

def to(*args)
@params = RouteParams.new(args).normalize
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def allow_mass_assignment_of(value)
class AllowMassAssignmentOfMatcher
attr_reader :failure_message, :failure_message_when_negated

alias failure_message_for_should failure_message
alias failure_message_for_should_not failure_message_when_negated

def initialize(attribute)
@attribute = attribute.to_s
@options = {}
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/active_model/allow_value_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,10 @@ def does_not_match?(instance)
def failure_message
"Did not expect #{expectation},\ngot#{error_description}"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Expected #{expectation},\ngot#{error_description}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
validator.allow_description(allowed_values)
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/active_model/disallow_value_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ def with_message(message, options={})
def failure_message
@allow_matcher.failure_message_when_negated
end
alias failure_message_for_should failure_message

def failure_message_when_negated
@allow_matcher.failure_message
end
alias failure_message_for_should_not failure_message_when_negated

def strict
@allow_matcher.strict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ def have_secure_password
class HaveSecurePasswordMatcher
attr_reader :failure_message

alias failure_message_for_should failure_message

CORRECT_PASSWORD = "aBcDe12345"
INCORRECT_PASSWORD = "password"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ def comparison_description
def failure_message
last_failing_submatcher.failure_message
end
alias failure_message_for_should failure_message

def failure_message_when_negated
last_failing_submatcher.failure_message_when_negated
end
alias failure_message_for_should_not failure_message_when_negated

private

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ def diff_to_compare
def failure_message
@disallow_value_matcher.failure_message
end
alias failure_message_for_should failure_message

def failure_message_when_negated
@disallow_value_matcher.failure_message_when_negated
end
alias failure_message_for_should_not failure_message_when_negated
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,10 @@ def description
def failure_message
first_failing_submatcher.failure_message
end
alias failure_message_for_should failure_message

def failure_message_when_negated
first_failing_submatcher.failure_message_when_negated
end
alias failure_message_for_should_not failure_message_when_negated

private

Expand Down
3 changes: 0 additions & 3 deletions lib/shoulda/matchers/active_model/validation_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module ActiveModel
class ValidationMatcher
attr_reader :failure_message

alias failure_message_for_should failure_message

def initialize(attribute)
@attribute = attribute
@strict = false
Expand All @@ -27,7 +25,6 @@ def strict
def failure_message_when_negated
@failure_message_when_negated || @failure_message
end
alias failure_message_for_should_not failure_message_when_negated

def matches?(subject)
@subject = subject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,10 @@ def matches?(subject)
def failure_message
"Expected #{expectation} (#{@problem})"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
description = "accepts_nested_attributes_for :#{@name}"
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/active_record/association_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -961,12 +961,10 @@ def description
def failure_message
"Expected #{expectation} (#{missing_options})"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

def matches?(subject)
@subject = subject
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/active_record/have_db_column_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ def matches?(subject)
def failure_message
"Expected #{expectation} (#{@missing})"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
desc = "have db column named #{@column}"
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/active_record/have_db_index_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ def matches?(subject)
def failure_message
"Expected #{expectation} (#{@missing})"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
if @options.key?(:unique)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ def initialize(attribute)

attr_reader :failure_message, :failure_message_when_negated

alias failure_message_for_should failure_message
alias failure_message_for_should_not failure_message_when_negated

def matches?(subject)
@subject = subject
if readonly_attributes.include?(@attribute)
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/active_record/serialize_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ def matches?(subject)
def failure_message
"Expected #{expectation} (#{@missing})"
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Did not expect #{expectation}"
end
alias failure_message_for_should_not failure_message_when_negated

def description
description = "serialize :#{@name}"
Expand Down
2 changes: 0 additions & 2 deletions lib/shoulda/matchers/independent/delegate_method_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,10 @@ def failure_message
"#{formatted_delegate_object_reader_method_name(include_module: true)}:" +
formatted_calls_on_delegate_object
end
alias failure_message_for_should failure_message

def failure_message_when_negated
"Expected #{class_under_test} not to #{description}, but it did"
end
alias failure_message_for_should_not failure_message_when_negated

protected

Expand Down

0 comments on commit 32c0e62

Please sign in to comment.