Class: RSpec::Fire::SupportArityMatcher
- Inherits:
-
Object
- Object
- RSpec::Fire::SupportArityMatcher
- Defined in:
- lib/rspec/fire/legacy.rb
Instance Attribute Summary collapse
-
#arity ⇒ Object
readonly
Returns the value of attribute arity.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
-
#initialize(arity) ⇒ SupportArityMatcher
constructor
A new instance of SupportArityMatcher.
- #matches?(method) ⇒ Boolean
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
#arity ⇒ Object (readonly)
Returns the value of attribute arity.
13 14 15 |
# File 'lib/rspec/fire/legacy.rb', line 13 def arity @arity end |
#method ⇒ Object (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_should ⇒ Object
20 21 22 23 |
# File 'lib/rspec/fire/legacy.rb', line 20 def "Wrong number of arguments for #{method.name}. " + "Expected #{arity_description}, got #{arity}." end |
#matches?(method) ⇒ 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 |