Commit f300ef0d by Matt Connolly Committed by Ryan Bigg

Add rspec matcher: act_as_paranoid

Fixes #126
parent 236861da
...@@ -166,3 +166,5 @@ class ActiveRecord::Base ...@@ -166,3 +166,5 @@ class ActiveRecord::Base
self.class.paranoia_column self.class.paranoia_column
end end
end end
require 'paranoia/rspec' if defined? RSpec
require 'rspec/expectations'
# Validate the subject's class did call "acts_as_paranoid"
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`" }
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment