I follow this guide: http://elixir-lang.org/getting-started/mix-otp/agent.html
So, in my Elixir project, I have the lib/kv/bucket.exs and the test for it is test/kv/bucket_test.exs .
lib/kv/bucket.exs
test/kv/bucket_test.exs
When I run the mixing test, I get the following error: ** (UndefinedFunctionError) undefined function KV.Bucket.start_link/0 (module KV.Bucket is not available) Did I miss something?
** (UndefinedFunctionError) undefined function KV.Bucket.start_link/0 (module KV.Bucket is not available)
Thus, the module should use the .ex extension instead of .exs , and you need to run mix compile to compile the new module. After that, mix test can find the module, and everything works as expected.
.ex
.exs
mix compile
mix test