Class: HaveSingletonMethodMatcher
- Inherits:
-
MethodMatcher
show all
- Defined in:
- lib/extensions/mspec/mspec/matchers/have_singleton_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_singleton_method.rb', line 9
def failure_message
["Expected #{@obj} to have singleton method '#{@method.to_s}'",
"but it does not"]
end
|
#matches?(obj) ⇒ Boolean
4
5
6
7
|
# File 'lib/extensions/mspec/mspec/matchers/have_singleton_method.rb', line 4
def matches?(obj)
@obj = obj
obj.singleton_methods(@include_super).include? @method
end
|
#negative_failure_message ⇒ Object
14
15
16
17
|
# File 'lib/extensions/mspec/mspec/matchers/have_singleton_method.rb', line 14
def negative_failure_message
["Expected #{@obj} NOT to have singleton method '#{@method.to_s}'",
"but it does"]
end
|