Method: Transpec::Syntax::MethodStub#conversion_target?

Defined in:
lib/transpec/syntax/method_stub.rb

#conversion_target?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/transpec/syntax/method_stub.rb', line 35

def conversion_target?
  return false unless dynamic_analysis_target?

  # Check if the method is RSpec's one or not.
  if runtime_data.run?(send_analysis_target_node)
    # If we have runtime data, check with it.
    defined_by_rspec?
  else
    # Otherwise check with a static whitelist.
    const_name = const_name(receiver_node)
    !CLASSES_DEFINING_OWN_STUB_METHOD.include?(const_name)
  end
end