diff --git a/lib/ex_unit_jumpstart/create_files.ex b/lib/ex_unit_jumpstart/create_files.ex index d6df492..be8cad3 100644 --- a/lib/ex_unit_jumpstart/create_files.ex +++ b/lib/ex_unit_jumpstart/create_files.ex @@ -12,7 +12,7 @@ defmodule ExUnitJumpstart.CreateFiles do String.replace(test_file.path, "_test.exs", ".ex") == code_file.path end) - unless test_file or config.dry_run do + unless test_file or config.fetch!(:dry_run) do IO.puts("Creating test file for #{code_file.path}") create_test_file(config, code_file) end diff --git a/lib/ex_unit_jumpstart/move_files.ex b/lib/ex_unit_jumpstart/move_files.ex index abff053..58f9ca0 100644 --- a/lib/ex_unit_jumpstart/move_files.ex +++ b/lib/ex_unit_jumpstart/move_files.ex @@ -41,11 +41,11 @@ defmodule ExUnitJumpstart.MoveFiles do Path.join(config[:test_dir], code_file.path) |> String.replace(".ex", "_test.exs") IO.puts("Moving #{test_file.path} to #{new_path}") - unless config.dry_run do - File.mkdir_p!(Path.dirname(new_path)) - File.rename!(Path.join(config[:test_dir], test_file.path), new_path) + unless config.fetch!(:dry_run) do + File.mkdir_p!(Path.dirname(new_path)) + File.rename!(Path.join(config[:test_dir], test_file.path), new_path) + end end end - end end