Compatibility fix for using cancan with rspec-instafail and rspec1
This commit is contained in:
		
							parent
							
								
									600a3e16a5
								
							
						
					
					
						commit
						3b33b36de9
					
				@ -1,5 +1,5 @@
 | 
				
			|||||||
RSpec = Spec unless defined? RSpec # for RSpec 1 compatability
 | 
					rspec_module = defined?(RSpec::Core) ? 'RSpec' : 'Spec'  # for RSpec 1 compatability
 | 
				
			||||||
RSpec::Matchers.define :be_able_to do |*args|
 | 
					Kernel.const_get(rspec_module)::Matchers.define :be_able_to do |*args|
 | 
				
			||||||
  match do |ability|
 | 
					  match do |ability|
 | 
				
			||||||
    ability.can?(*args)
 | 
					    ability.can?(*args)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user