From caed4fcee512d276eb6a0a09351034eb931f5b3c Mon Sep 17 00:00:00 2001 From: Ryan Bates Date: Wed, 18 Aug 2010 16:22:43 -0700 Subject: [PATCH] use RSpec namespace for matcher - closes #119 --- lib/cancan/matchers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cancan/matchers.rb b/lib/cancan/matchers.rb index a71c458..6c76c54 100644 --- a/lib/cancan/matchers.rb +++ b/lib/cancan/matchers.rb @@ -1,4 +1,5 @@ -Spec::Matchers.define :be_able_to do |*args| +RSpec = Spec unless defined? RSpec # for RSpec 1 compatability +RSpec::Matchers.define :be_able_to do |*args| match do |ability| ability.can?(*args) end