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