Skip to content

Commit

Permalink
Added Rspec matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardarella authored and binarylogic committed Oct 20, 2009
1 parent 003bd21 commit 3424ecf
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions rspec_matchers/authlogic.rb
@@ -0,0 +1,37 @@
# Place this file into your spec/support/matchers directory
#
# Example:
#
# describe User do
# it { should have_authlogic }
# end

module Authlogic
module RspecMatchers
def have_authlogic
HaveAuthlogic.new
end

class HaveAuthlogic

def matches?(subject)
subject.respond_to?(:password=) && subject.respond_to?(:valid_password?)
end

def failure_message
"Add the line 'acts_as_authentic' to your model"
end

def description
"have Authlogic"
end
end
end

end

if defined?(Spec)
Spec::Runner.configure do |config|
config.include(Authlogic::RspecMatchers)
end
end

0 comments on commit 3424ecf

Please sign in to comment.