Class: MethodMatcher

Inherits:
Object show all
Defined in:
lib/mspec/matchers/method.rb

Instance Method Summary collapse

Constructor Details

#initialize(method, include_super = true) ⇒ MethodMatcher

Returns a new instance of MethodMatcher.



4
5
6
7
8
# File 'lib/mspec/matchers/method.rb', line 4

def initialize(method, include_super=true)
  @include_super = include_super
  version = SpecVersion.new(RUBY_VERSION) <=> "1.9"
  @method = version < 0 ? method.to_s : method
end

Instance Method Details

#matches?(mod) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (Exception)


10
11
12
# File 'lib/mspec/matchers/method.rb', line 10

def matches?(mod)
  raise Exception, "define #matches? in the subclass"
end