Class: CodeDrivenDevelopment::Rule::InstanceMethod
Instance Method Summary
collapse
#initialize
Instance Method Details
#capable? ⇒ Boolean
4
5
6
|
# File 'lib/code_driven_development/rule/instance_method.rb', line 4
def capable?
code.sexp_type == :defn
end
|
#test ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/code_driven_development/rule/instance_method.rb', line 8
def test
new_context = TestComponent::Context.new(%Q("##{method_name}"))
recurse(method_body, new_context)
test_context << new_context
new_context.subject = "obj.#{method_name}"
new_context.lets << TestComponent::Let.new(:obj, "described_class.new")
end
|