summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorMatteo Centenaro <bugant@gmail.com>2018-10-10 18:19:47 +0200
committerw0rp <w0rp@users.noreply.github.com>2018-10-10 17:19:47 +0100
commitbf1ac8e822835ac2b0e1173e1e014c773b8e51a6 (patch)
treec07810d24da1049e22910538555d4a5db2e941b3 /test/command_callback
parentea49cc759f7254c03a3515371ffad23e6b326d07 (diff)
downloadale-bf1ac8e822835ac2b0e1173e1e014c773b8e51a6.zip
FIX: use mix from the project root directory (#1954)
* FIX: use mix from the project root directory * Move find root project function to autoloaded handlers * add tests for #ale#handlers#elixr#FindMixProjectRoot
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/elixir_paths/mix_project/lib/foo.ex0
-rw-r--r--test/command_callback/elixir_paths/mix_project/mix.exs3
-rw-r--r--test/command_callback/test_elixir_mix_command_callbacks.vader7
3 files changed, 10 insertions, 0 deletions
diff --git a/test/command_callback/elixir_paths/mix_project/lib/foo.ex b/test/command_callback/elixir_paths/mix_project/lib/foo.ex
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/command_callback/elixir_paths/mix_project/lib/foo.ex
diff --git a/test/command_callback/elixir_paths/mix_project/mix.exs b/test/command_callback/elixir_paths/mix_project/mix.exs
new file mode 100644
index 00000000..419685ae
--- /dev/null
+++ b/test/command_callback/elixir_paths/mix_project/mix.exs
@@ -0,0 +1,3 @@
+defmodule Test.MixProject do
+ # fake mix project file
+end
diff --git a/test/command_callback/test_elixir_mix_command_callbacks.vader b/test/command_callback/test_elixir_mix_command_callbacks.vader
index 18fb13ed..9315a850 100644
--- a/test/command_callback/test_elixir_mix_command_callbacks.vader
+++ b/test/command_callback/test_elixir_mix_command_callbacks.vader
@@ -17,3 +17,10 @@ Execute(The default mix command should be correct):
\ ale#path#CdString(ale#path#Simplify(g:dir . '/mix_paths/wrapped_project'))
\ . g:env_prefix
\ . 'mix compile %s'
+
+Execute(The FindMixProjectRoot should detect the project root directory via mix.exs):
+ silent execute 'file ' . fnameescape(g:dir . '/elixir_paths/mix_project/lib/app.ex')
+
+ AssertEqual
+ \ ale#path#Simplify(g:dir . '/elixir_paths/mix_project'),
+ \ ale#handlers#elixir#FindMixProjectRoot(bufnr(''))