Skip to content

Commit

Permalink
Merge pull request ryanb#421 from amc-projects/master
Browse files Browse the repository at this point in the history
Compatibility fix for rspec-instafail and rspec1
  • Loading branch information
ryanb committed Jul 23, 2011
2 parents e0492f5 + 3b33b36 commit 987dce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cancan/matchers.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 987dce0

Please sign in to comment.