summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/puppet-test-files/new-style-module/lib/puppet/types/exampletype.rb0
-rw-r--r--test/puppet-test-files/new-style-module/metadata.json0
-rw-r--r--test/puppet-test-files/new-style-module/template/template.epp0
-rw-r--r--test/puppet-test-files/old-style-module/manifests/init.pp0
-rw-r--r--test/puppet-test-files/old-style-module/templates/template.epp0
-rw-r--r--test/test_puppet_path_detection.vader22
6 files changed, 22 insertions, 0 deletions
diff --git a/test/puppet-test-files/new-style-module/lib/puppet/types/exampletype.rb b/test/puppet-test-files/new-style-module/lib/puppet/types/exampletype.rb
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/puppet-test-files/new-style-module/lib/puppet/types/exampletype.rb
diff --git a/test/puppet-test-files/new-style-module/metadata.json b/test/puppet-test-files/new-style-module/metadata.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/puppet-test-files/new-style-module/metadata.json
diff --git a/test/puppet-test-files/new-style-module/template/template.epp b/test/puppet-test-files/new-style-module/template/template.epp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/puppet-test-files/new-style-module/template/template.epp
diff --git a/test/puppet-test-files/old-style-module/manifests/init.pp b/test/puppet-test-files/old-style-module/manifests/init.pp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/puppet-test-files/old-style-module/manifests/init.pp
diff --git a/test/puppet-test-files/old-style-module/templates/template.epp b/test/puppet-test-files/old-style-module/templates/template.epp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/puppet-test-files/old-style-module/templates/template.epp
diff --git a/test/test_puppet_path_detection.vader b/test/test_puppet_path_detection.vader
new file mode 100644
index 00000000..f8d3a0fa
--- /dev/null
+++ b/test/test_puppet_path_detection.vader
@@ -0,0 +1,22 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test')
+
+ runtime ale_linters/puppet/languageserver.vim
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+
+Execute(old-style module should find its root correctly):
+ call ale#test#SetFilename('puppet-test-files/old-style-module/manifests/init.pp')
+
+ AssertEqual
+ \ ale#path#Simplify(g:dir . '/puppet-test-files/old-style-module'),
+ \ ale_linters#puppet#languageserver#GetProjectRoot(bufnr(''))
+
+Execute(new-style module should find its root correctly):
+ call ale#test#SetFilename('puppet-test-files/new-style-module/lib/puppet/types/exampletype.rb')
+
+ AssertEqual
+ \ ale#path#Simplify(g:dir . '/puppet-test-files/new-style-module'),
+ \ ale_linters#puppet#languageserver#GetProjectRoot(bufnr(''))