Class: CodeDrivenDevelopment::Stubber::NestedCallStubber
Instance Method Summary
collapse
#initialize, #method_name
Instance Method Details
#befores ⇒ Object
12
13
14
|
# File 'lib/code_driven_development/stubber/nested_call_stubber.rb', line 12
def befores
substubber.befores << "allow(#{substubber.method_name}).to receive(:#{method_name}).and_return(#{method_name})"
end
|
#body ⇒ Object
16
17
18
|
# File 'lib/code_driven_development/stubber/nested_call_stubber.rb', line 16
def body
substubber.body << "expect(#{substubber.method_name}).to have_received :#{method_name}"
end
|
#doubles ⇒ Object
20
21
22
|
# File 'lib/code_driven_development/stubber/nested_call_stubber.rb', line 20
def doubles
substubber.doubles << method_name.to_sym
end
|
#human_name ⇒ Object
8
9
10
|
# File 'lib/code_driven_development/stubber/nested_call_stubber.rb', line 8
def human_name
"#{substubber.human_name}.#{method_name}"
end
|
#receiver_value ⇒ Object
4
5
6
|
# File 'lib/code_driven_development/stubber/nested_call_stubber.rb', line 4
def receiver_value
receiver[2]
end
|