class Allowy::Matchers::AbleToMatcher
Public Class Methods
new(action, subject=nil, *params)
click to toggle source
# File lib/allowy/matchers.rb, line 5 def initialize(action, subject=nil, *params) @action, @subject, @params = action, subject, params end
Public Instance Methods
description()
click to toggle source
# File lib/allowy/matchers.rb, line 17 def description say "be able to" end
failure_message()
click to toggle source
# File lib/allowy/matchers.rb, line 21 def failure_message say "expected to be able to" end
matches?(access_control)
click to toggle source
# File lib/allowy/matchers.rb, line 13 def matches?(access_control) access_control.can?(@action, @subject, *@params) end
negative_failure_message()
click to toggle source
# File lib/allowy/matchers.rb, line 25 def negative_failure_message say "expected NOT to be able to" end
Also aliased as: failure_message_when_negated
say(msg)
click to toggle source
# File lib/allowy/matchers.rb, line 9 def say msg "#{msg} #{@action} #{@subject.inspect}" end