Class: Mocha::MethodMatcher

Inherits:
Object show all
Defined in:
lib/mocha/method_matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expected_method_name) ⇒ MethodMatcher

Returns a new instance of MethodMatcher.



7
8
9
# File 'lib/mocha/method_matcher.rb', line 7

def initialize(expected_method_name)
  @expected_method_name = expected_method_name
end

Instance Attribute Details

#expected_method_nameObject (readonly)

Returns the value of attribute expected_method_name.



5
6
7
# File 'lib/mocha/method_matcher.rb', line 5

def expected_method_name
  @expected_method_name
end

Instance Method Details

#match?(actual_method_name) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/mocha/method_matcher.rb', line 11

def match?(actual_method_name)
  @expected_method_name == actual_method_name
end

#mocha_inspectObject



15
16
17
# File 'lib/mocha/method_matcher.rb', line 15

def mocha_inspect
  "#{@expected_method_name}"
end