Sha256: 045f0476270b2d87983ed4a0dea3b8259cf9ee67f829f2fd4891939ae4bcc2b8

Contents?: true

Size: 330 Bytes

Versions: 4

Compression:

Stored size: 330 Bytes

Contents

Spec::Matchers.define :be_able_to do |*args|
  match do |ability|
    ability.can?(*args)
  end

  failure_message_for_should do |ability|
    "expected to be able to #{args.map(&:inspect).join(" ")}"
  end

  failure_message_for_should_not do |ability|
    "expected not to be able to #{args.map(&:inspect).join(" ")}"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cancan-1.3.2 lib/cancan/matchers.rb
cancan-1.2.0 lib/cancan/matchers.rb
cancan-1.1.1 lib/cancan/matchers.rb
cancan-1.1.0 lib/cancan/matchers.rb