Skip to content

Instantly share code, notes, and snippets.

@santuxus
santuxus / have_paper_trail.rb
Created February 8, 2013 15:10
rspec matcher for paper_trail 1.6.5 (the latest version working with rails 2.3.x)
Spec::Matchers.define :have_paper_trail do
match do |object|
has_class_methods?(object) && has_instance_methods?(object)
end
failure_message_for_should do |object|
"Expected #{object.class} to have a has_paper_trail"
end
failure_message_for_should_not do |object|