lib/factory_strategist/ext/rspec/core/example/procsy.rb
def replaced_from_create_to(method_name)
              block_body = metadata[:block].body
              new_body = "Proc.new{ #{block_body.gsub("create", method_name.to_s)} }"
              metadata[:block] = eval(new_body) # rubocop:disable Security/Eval
              self
            end
# Generate new proc to inspect the best strategy with method given as argument
#
# @param method_name  [Symbol, String] build strategy name: `build` or `build_stubbed`
# @return [Proc] new example with replacing `FactoryBot#create` to passed method
Generate new proc to inspect the best strategy with method given as argument
Generate new proc to inspect the best strategy with method given as argument
def replaced_from_create_to(method_name)
              block_body = metadata[:block].body
              new_body = "Proc.new{ #{block_body.gsub("create", method_name.to_s)} }"
              metadata[:block] = eval(new_body) 
              self
            end
def replaced_from_create_to ( method_name ) block_body = metadata [ :block ] . body new_body = "Proc.new{ #{block_body.gsub("create", method_name.to_s)} }" metadata [ :block ] = eval ( new_body ) self end
Generate new proc to inspect the best strategy with method given as argument
Generate new proc to inspect the best strategy with method given as argument
# rubocop:disable Security/Eval
new example with replacing `FactoryBot#create` to passed method
new example with replacing ` FactoryBot#create ` to passed method
Proc
method_name
build strategy name: `build` or `build_stubbed`
build strategy name : ` build ` or ` build_stubbed `