Skip to content

Commit

Permalink
Merge pull request #156 from lime/rspec-deprecations
Browse files Browse the repository at this point in the history
Fix RSpec 3.x deprecations
  • Loading branch information
radar committed Aug 29, 2014
2 parents ca58b27 + 40b7af5 commit fe70628
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/paranoia/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
RSpec::Matchers.define :act_as_paranoid do
match { |subject| subject.class.ancestors.include?(Paranoia) }

failure_message_for_should { "#{subject.class} should use `acts_as_paranoid`" }
failure_message_for_should_not { "#{subject.class} should not use `acts_as_paranoid`" }
failure_message { "expected #{subject.class} to use `acts_as_paranoid`" }
failure_message_when_negated { "expected #{subject.class} not to use `acts_as_paranoid`" }

# RSpec 2 compatibility:
alias_method :failure_message_for_should, :failure_message
alias_method :failure_message_for_should_not, :failure_message_when_negated
end

0 comments on commit fe70628

Please sign in to comment.