Skip to content
This repository
Browse code

Compatibility fix for using cancan with rspec-instafail and rspec1

  • Loading branch information...
commit 3b33b36de9142ab95a01130e5234dc4eeff19196 1 parent 600a3e1
Michael MacDonald schlick authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 lib/cancan/matchers.rb
4 lib/cancan/matchers.rb
... ... @@ -1,5 +1,5 @@
1   -RSpec = Spec unless defined? RSpec # for RSpec 1 compatability
2   -RSpec::Matchers.define :be_able_to do |*args|
  1 +rspec_module = defined?(RSpec::Core) ? 'RSpec' : 'Spec' # for RSpec 1 compatability
  2 +Kernel.const_get(rspec_module)::Matchers.define :be_able_to do |*args|
3 3 match do |ability|
4 4 ability.can?(*args)
5 5 end

0 comments on commit 3b33b36

Please sign in to comment.
Something went wrong with that request. Please try again.