Class: RSpec::Fire::SupportArityMatcher

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arity) ⇒ SupportArityMatcher

Returns a new instance of SupportArityMatcher.



28
29
30
# File 'lib/rspec/fire.rb', line 28

def initialize(arity)
  @arity = arity
end

Instance Attribute Details

#arityObject (readonly)

Returns the value of attribute arity.



32
33
34
# File 'lib/rspec/fire.rb', line 32

def arity
  @arity
end

#methodObject (readonly)

Returns the value of attribute method.



32
33
34
# File 'lib/rspec/fire.rb', line 32

def method
  @method
end

Instance Method Details

#failure_message_for_shouldObject



39
40
41
42
# File 'lib/rspec/fire.rb', line 39

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

#matches?(method) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
37
# File 'lib/rspec/fire.rb', line 34

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