From 53f5fe71bb55200ff2ff9aaafbef8e6008a2b50f Mon Sep 17 00:00:00 2001 From: Tom Janssens Date: Mon, 24 Jun 2013 12:33:12 +0200 Subject: [PATCH] Cleaned up the elixir test_helper.exs a bit --- lib/elixir/test/elixir/test_helper.exs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/elixir/test/elixir/test_helper.exs b/lib/elixir/test/elixir/test_helper.exs index abd34b1a52..27367cf375 100644 --- a/lib/elixir/test/elixir/test_helper.exs +++ b/lib/elixir/test/elixir/test_helper.exs @@ -18,14 +18,20 @@ defmodule PathHelpers do Path.join(tmp_path, extra) end + def elixirc(args) do + runcmd(elixirc_executable,args) + end + + def elixir(args) do + runcmd(elixir_executable,args) + end + if match? { :win32, _ }, :os.type do def executable_extension, do: ".bat" - def elixirc(args), do: :os.cmd binary_to_list("#{elixirc_executable} #{:unicode.characters_to_binary(args)} 2>&1") - def elixir(args), do: :os.cmd binary_to_list("#{elixir_executable} #{:unicode.characters_to_binary(args)} 2>&1") + defp runcmd(executable,args), do: :os.cmd binary_to_list("#{executable} #{:unicode.characters_to_binary(args)} 2>&1") else def executable_extension, do: "" - def elixirc(args), do: :os.cmd binary_to_list("#{elixirc_executable} #{:unicode.characters_to_binary(args)}") - def elixir(args), do: :os.cmd binary_to_list("#{elixir_executable} #{:unicode.characters_to_binary(args)}") + defp runcmd(executable,args), do: :os.cmd binary_to_list("#{executable} #{:unicode.characters_to_binary(args)}") end def elixir_executable do @@ -35,7 +41,6 @@ defmodule PathHelpers do def elixirc_executable do Path.expand("../../../../../bin/elixirc#{executable_extension}", __FILE__) end - end defmodule CompileAssertion do