Class: RSpec::Fire::SupportArityMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/fire/legacy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arity) ⇒ SupportArityMatcher

Returns a new instance of SupportArityMatcher.



9
10
11
# File 'lib/rspec/fire/legacy.rb', line 9

def initialize(arity)
  @arity = arity
end

Instance Attribute Details

#arityObject (readonly)

Returns the value of attribute arity.



13
14
15
# File 'lib/rspec/fire/legacy.rb', line 13

def arity
  @arity
end

#methodObject (readonly)

Returns the value of attribute method.



13
14
15
# File 'lib/rspec/fire/legacy.rb', line 13

def method
  @method
end

Instance Method Details

#failure_message_for_shouldObject



20
21
22
23
# File 'lib/rspec/fire/legacy.rb', line 20

def failure_message_for_should
  "Wrong number of arguments for #{method.name}. " +
    "Expected #{arity_description}, got #{arity}."
end

#matches?(method) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/rspec/fire/legacy.rb', line 15

def matches?(method)
  @method = method
  min_arity <= arity && arity <= max_arity
end