Class: RSpec::Support::MethodSignatureExpectation Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-support/lib/rspec/support/method_signature_verifier.rb |
Overview
Encapsulates expectations about the number of arguments and allowed/required keyword args of a given method.
Class Method Summary
- .new ⇒ MethodSignatureExpectation constructor Internal use only
Instance Attribute Summary
- #empty? ⇒ Boolean readonly Internal use only
- #expect_arbitrary_keywords rw Internal use only
- #expect_unlimited_arguments rw Internal use only
- #keywords rw Internal use only
- #keywords=(values) rw Internal use only
- #max_count rw Internal use only
- #max_count=(number) rw Internal use only
- #min_count rw Internal use only
- #min_count=(number) rw Internal use only
Instance Attribute Details
#empty? ⇒ Boolean
(readonly)
# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 247
def empty? @min_count.nil? && @keywords.to_a.empty? && !@expect_arbitrary_keywords && !@expect_unlimited_arguments end
#expect_arbitrary_keywords (rw)
[ GitHub ]# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 231
attr_accessor :expect_unlimited_arguments, :expect_arbitrary_keywords
#expect_unlimited_arguments (rw)
[ GitHub ]# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 231
attr_accessor :expect_unlimited_arguments, :expect_arbitrary_keywords
#keywords (rw)
[ GitHub ]#keywords=(values) (rw)
[ GitHub ]# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 254
def keywords=(values) @keywords = values.to_a || [] end
#max_count (rw)
[ GitHub ]#max_count=(number) (rw)
# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 233
def max_count=(number) raise ArgumentError, 'must be a non-negative integer or nil' \ unless number.nil? || (number.is_a?(Integer) && number >= 0) @max_count = number end
#min_count (rw)
[ GitHub ]#min_count=(number) (rw)
# File 'rspec-support/lib/rspec/support/method_signature_verifier.rb', line 240
def min_count=(number) raise ArgumentError, 'must be a non-negative integer or nil' \ unless number.nil? || (number.is_a?(Integer) && number >= 0) @min_count = number end