我试图在测试中启动IEx.pry
。但是我无法在iex会话中运行测试。请注意,我没有使用混音。如何在IEx中运行ExUnit测试
[email protected]:~/exercism/elixir/nucleotide-count$ iex test.exs
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]
Interactive Elixir (1.3.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> ExUnit.run
** (exit) exited in: GenServer.call(ExUnit.Server, {:take_async_cases, 8}, 60000)
** (EXIT) time out
(elixir) lib/gen_server.ex:604: GenServer.call/3
(ex_unit) lib/ex_unit/runner.ex:71: ExUnit.Runner.loop/2
(stdlib) timer.erl:166: :timer.tc/1
(ex_unit) lib/ex_unit/runner.ex:13: ExUnit.Runner.run/2
代码正确加载,我可以直接与TheTest."test adds two numbers"({})
调用它:
ExUnit.start
defmodule Calc do
def add(a,b) do
a + b
end
end
defmodule TheTest do
use ExUnit.Case
test "adds two numbers" do
require IEx
IEx.pry
assert Calc.add(1, 2) == 3
end
end
我尝试用ExUnit.run
挂起并最终超时运行。但我希望能够启动整个套件。
你为什么不用'mix'? – Simone
您可能会发现这有帮助http://stackoverflow.com/questions/29671156/pry-while-testing – Simone
我相信,既然你不使用'mix'你应该有足够的勇气来自己启动'ExUnit'服务器应用程序。 – mudasobwa