Class: CodeDrivenDevelopment::Rule::MethodCall
Instance Method Summary
collapse
#initialize
Instance Method Details
#capable? ⇒ Boolean
4
5
6
7
|
# File 'lib/code_driven_development/rule/method_call.rb', line 4
def capable?
code.sexp_type == :call &&
stubber.method_name != :validate
end
|
#test ⇒ Object
9
10
11
12
13
|
# File 'lib/code_driven_development/rule/method_call.rb', line 9
def test
test_context.doubles.concat(stubber.doubles.map { |sym| TestComponent::Double.new(sym) })
test_context.befores.concat(stubber.befores)
test_context << TestComponent::Test.new("calls #{stubber.human_name}", ["subject"] + stubber.body)
end
|