Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #421 from amc-projects/master

Compatibility fix for rspec-instafail and rspec1
  • Loading branch information...
commit 987dce0dc26b327dafa4746db0977305e64db050 2 parents e0492f5 + 3b33b36
Ryan Bates authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cancan/matchers.rb
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.