Module: RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
- Included in:
- RR::DoubleDefinitions::DoubleDefinition
- Defined in:
- lib/rr/double_definitions/double_definition.rb
Instance Method Summary collapse
- #exact_match?(*arguments) ⇒ Boolean
- #expected_arguments ⇒ Object
- #implementation_is_original_method? ⇒ Boolean
-
#ordered? ⇒ Boolean
Double#ordered? returns true when the Double is ordered.
- #terminal? ⇒ Boolean
-
#verbose? ⇒ Boolean
Double#verbose? returns true when verbose has been called on it.
- #verify_method_signature? ⇒ Boolean (also: #strong?)
- #wildcard_match?(*arguments) ⇒ Boolean
Instance Method Details
#exact_match?(*arguments) ⇒ Boolean
315 316 317 318 |
# File 'lib/rr/double_definitions/double_definition.rb', line 315 def exact_match?(*arguments) raise(Errors::DoubleDefinitionError, "#argument_expectation must be defined on #{inspect}") unless @argument_expectation @argument_expectation.exact_match?(*arguments) end |
#expected_arguments ⇒ Object
330 331 332 |
# File 'lib/rr/double_definitions/double_definition.rb', line 330 def expected_arguments argument_expectation ? argument_expectation.expected_arguments : [] end |
#implementation_is_original_method? ⇒ Boolean
334 335 336 |
# File 'lib/rr/double_definitions/double_definition.rb', line 334 def implementation_is_original_method? implementation_strategy.is_a?(Strategies::Implementation::Proxy) end |
#ordered? ⇒ Boolean
Double#ordered? returns true when the Double is ordered.
mock(subject).method_name.ordered?
305 306 307 |
# File 'lib/rr/double_definitions/double_definition.rb', line 305 def ordered? @ordered end |
#terminal? ⇒ Boolean
325 326 327 328 |
# File 'lib/rr/double_definitions/double_definition.rb', line 325 def terminal? raise(Errors::DoubleDefinitionError, "#argument_expectation must be defined on #{inspect}") unless @times_matcher @times_matcher.terminal? end |
#verbose? ⇒ Boolean
Double#verbose? returns true when verbose has been called on it. It returns true when the double is set to print each method call it receives.
311 312 313 |
# File 'lib/rr/double_definitions/double_definition.rb', line 311 def verbose? @verbose ? true : false end |
#verify_method_signature? ⇒ Boolean Also known as: strong?
338 339 340 |
# File 'lib/rr/double_definitions/double_definition.rb', line 338 def verify_method_signature? !!@verify_method_signature end |
#wildcard_match?(*arguments) ⇒ Boolean
320 321 322 323 |
# File 'lib/rr/double_definitions/double_definition.rb', line 320 def wildcard_match?(*arguments) raise(Errors::DoubleDefinitionError, "#argument_expectation must be defined on #{inspect}") unless @argument_expectation @argument_expectation.wildcard_match?(*arguments) end |