Class: RSpec::Fire::SupportArityMatcher
- Inherits:
-
Object
- Object
- RSpec::Fire::SupportArityMatcher
- Defined in:
- lib/rspec/fire.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.
28 29 30 |
# File 'lib/rspec/fire.rb', line 28 def initialize(arity) @arity = arity end |
Instance Attribute Details
#arity ⇒ Object (readonly)
Returns the value of attribute arity.
32 33 34 |
# File 'lib/rspec/fire.rb', line 32 def arity @arity end |
#method ⇒ Object (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_should ⇒ Object
39 40 41 42 |
# File 'lib/rspec/fire.rb', line 39 def "Wrong number of arguments for #{method.name}. " + "Expected #{arity_description}, got #{arity}." end |
#matches?(method) ⇒ Boolean
34 35 36 37 |
# File 'lib/rspec/fire.rb', line 34 def matches?(method) @method = method min_arity <= arity && arity <= max_arity end |