Permalink
Browse files

Merge pull request #421 from amc-projects/master

Compatibility fix for rspec-instafail and rspec1
  • Loading branch information...
2 parents e0492f5 + 3b33b36 commit 987dce0dc26b327dafa4746db0977305e64db050 @ryanb committed Jul 23, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cancan/matchers.rb
View
@@ -1,5 +1,5 @@
-RSpec = Spec unless defined? RSpec # for RSpec 1 compatability
-RSpec::Matchers.define :be_able_to do |*args|
+rspec_module = defined?(RSpec::Core) ? 'RSpec' : 'Spec' # for RSpec 1 compatability
+Kernel.const_get(rspec_module)::Matchers.define :be_able_to do |*args|
match do |ability|
ability.can?(*args)
end

0 comments on commit 987dce0

Please sign in to comment.