Skip to content

Commit

Permalink
Replace to RSpec::Core::Example::Procsy#replaced_from_create_to
Browse files Browse the repository at this point in the history
  • Loading branch information
neko314 committed Nov 9, 2021
1 parent eaeab9b commit 357dacf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/factory_strategist/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ def run_successfully?(example)
end

def run_successfully_with?(method_name, example)
ex = example_replaced_from_create_to(method_name, example)
ex = example.replaced_from_create_to(method_name)
run_successfully?(ex)
end

def example_replaced_from_create_to(method_name, example)
block_body = example.example.metadata[:block].body
new_body = "Proc.new{ #{block_body.gsub("create", method_name.to_s)} }"
eval(new_body) # rubocop:disable Security/Eval
end

0 comments on commit 357dacf

Please sign in to comment.