We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e0492f5 + 3b33b36 commit 987dce0Copy full SHA for 987dce0
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|
+rspec_module = defined?(RSpec::Core) ? 'RSpec' : 'Spec' # for RSpec 1 compatability
+Kernel.const_get(rspec_module)::Matchers.define :be_able_to do |*args|
3
match do |ability|
4
ability.can?(*args)
5
end
0 commit comments