Class: CodeDrivenDevelopment::Stubber::AbstractStubber
- Inherits:
-
Object
- Object
- CodeDrivenDevelopment::Stubber::AbstractStubber
show all
- Defined in:
- lib/code_driven_development/stubber/abstract_stubber.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AbstractStubber.
4
5
6
|
# File 'lib/code_driven_development/stubber/abstract_stubber.rb', line 4
def initialize(sexp)
@sexp = sexp
end
|
Instance Method Details
#befores ⇒ Object
12
13
14
15
16
|
# File 'lib/code_driven_development/stubber/abstract_stubber.rb', line 12
def befores
[
"allow(#{receiver_value}).to receive(:#{method_name}).and_return(#{method_name})"
]
end
|
#body ⇒ Object
24
25
26
27
28
|
# File 'lib/code_driven_development/stubber/abstract_stubber.rb', line 24
def body
[
"expect(#{receiver_value}).to have_received :#{method_name}"
]
end
|
#doubles ⇒ Object
18
19
20
21
22
|
# File 'lib/code_driven_development/stubber/abstract_stubber.rb', line 18
def doubles
[
method_name.to_sym
]
end
|
#method_name ⇒ Object
8
9
10
|
# File 'lib/code_driven_development/stubber/abstract_stubber.rb', line 8
def method_name
sexp[2]
end
|