Class: RR::DoubleDefinitions::DoubleDefinition

Inherits:
Object
  • Object
show all
Includes:
ArgumentDefinitionConstructionMethods, DefinitionConstructionMethods, StateQueryMethods, TimesDefinitionConstructionMethods, Strategies::StrategyMethods, Space::Reader
Defined in:
lib/rr/double_definitions/double_definition.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ArgumentDefinitionConstructionMethods, DefinitionConstructionMethods, StateQueryMethods, TimesDefinitionConstructionMethods

Constant Summary

ORIGINAL_METHOD =
Object.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Strategies::StrategyMethods

#any_instance_of!, #dont_allow!, #instance_of!, #mock!, #proxy!, #strong!, #stub!

Methods included from StateQueryMethods

#exact_match?, #expected_arguments, #implementation_is_original_method?, #ordered?, #terminal?, #verbose?, #verify_method_signature?, #wildcard_match?

Methods included from DefinitionConstructionMethods

#after_call, #implemented_by, #implemented_by_original_method, #ordered, #returns, #verbose, #verify_method_signature, #yields

Methods included from TimesDefinitionConstructionMethods

#any_number_of_times, #at_least, #at_most, #never, #once, #times, #twice

Methods included from ArgumentDefinitionConstructionMethods

#with, #with_any_args, #with_no_args

Methods included from Space::Reader

#space

Constructor Details

#initialize(double_definition_create) ⇒ DoubleDefinition



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rr/double_definitions/double_definition.rb', line 17

def initialize(double_definition_create)
  @implementation = nil
  @argument_expectation = nil
  @times_matcher = nil
  @after_call_proc = nil
  @yields_value = nil
  @double_definition_create = double_definition_create
  @ordered = false
  @verbose = false
  @verify_method_signature = false
end

Instance Attribute Details

#after_call_procObject

Returns the value of attribute after_call_proc



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def after_call_proc
  @after_call_proc
end

#argument_expectationObject

Returns the value of attribute argument_expectation



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def argument_expectation
  @argument_expectation
end

#doubleObject

Returns the value of attribute double



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def double
  @double
end

#double_definition_createObject

Returns the value of attribute double_definition_create



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def double_definition_create
  @double_definition_create
end

#implementationObject

Returns the value of attribute implementation



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def implementation
  @implementation
end

#times_matcherObject

Returns the value of attribute times_matcher



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def times_matcher
  @times_matcher
end

#yields_valueObject

Returns the value of attribute yields_value



5
6
7
# File 'lib/rr/double_definitions/double_definition.rb', line 5

def yields_value
  @yields_value
end

Instance Method Details

#any_instance_of(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



356
357
358
# File 'lib/rr/double_definitions/double_definition.rb', line 356

def any_instance_of(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).any_instance_of(subject, method_name, &definition_eval_block)
end

#dont_allow(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



344
345
346
# File 'lib/rr/double_definitions/double_definition.rb', line 344

def dont_allow(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).dont_allow(subject, method_name, &definition_eval_block)
end

#instance_of(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



360
361
362
# File 'lib/rr/double_definitions/double_definition.rb', line 360

def instance_of(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).instance_of(subject, method_name, &definition_eval_block)
end

#mock(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



336
337
338
# File 'lib/rr/double_definitions/double_definition.rb', line 336

def mock(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).mock(subject, method_name, &definition_eval_block)
end

#proxy(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



348
349
350
# File 'lib/rr/double_definitions/double_definition.rb', line 348

def proxy(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).proxy(subject, method_name, &definition_eval_block)
end

#root_subjectObject



33
34
35
# File 'lib/rr/double_definitions/double_definition.rb', line 33

def root_subject
  double_definition_create.root_subject
end

#strong(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



352
353
354
# File 'lib/rr/double_definitions/double_definition.rb', line 352

def strong(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).strong(subject, method_name, &definition_eval_block)
end

#stub(subject = DoubleDefinitionCreate::NO_SUBJECT, method_name = nil, &definition_eval_block) ⇒ Object



340
341
342
# File 'lib/rr/double_definitions/double_definition.rb', line 340

def stub(subject=DoubleDefinitionCreate::NO_SUBJECT, method_name=nil, &definition_eval_block)
  ChildDoubleDefinitionCreate.new(self).stub(subject, method_name, &definition_eval_block)
end

#subjectObject



29
30
31
# File 'lib/rr/double_definitions/double_definition.rb', line 29

def subject
  double_definition_create.subject
end