Class: HaveProtectedInstanceMethodMatcher
- Inherits:
-
MethodMatcher
show all
- Defined in:
- lib/extensions/mspec/mspec/matchers/have_protected_instance_method.rb
Instance Method Summary
collapse
#initialize
#convert_name
Constructor Details
This class inherits a constructor from MethodMatcher
Instance Method Details
#failure_message ⇒ Object
9
10
11
12
|
# File 'lib/extensions/mspec/mspec/matchers/have_protected_instance_method.rb', line 9
def failure_message
["Expected #{@mod} to have protected instance method '#{@method.to_s}'",
"but it does not"]
end
|
#matches?(mod) ⇒ Boolean
4
5
6
7
|
# File 'lib/extensions/mspec/mspec/matchers/have_protected_instance_method.rb', line 4
def matches?(mod)
@mod = mod
mod.protected_instance_methods(@include_super).include? @method
end
|
#negative_failure_message ⇒ Object
14
15
16
17
|
# File 'lib/extensions/mspec/mspec/matchers/have_protected_instance_method.rb', line 14
def negative_failure_message
["Expected #{@mod} NOT to have protected instance method '#{@method.to_s}'",
"but it does"]
end
|