summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-07-07 12:08:14 +0100
committerGitHub <noreply@github.com>2018-07-07 12:08:14 +0100
commitc1a2aa27f36690dec1433a15307fe7198ec27629 (patch)
tree71fa3f04bc6f14672383e288ff50280c860cc901 /test
parent4999ad7e7860459f4ebea2d36d63317e88dd3870 (diff)
parentf78db619d45e54949a8d5d667dffef6ea1e6adb3 (diff)
downloadale-c1a2aa27f36690dec1433a15307fe7198ec27629.zip
Merge pull request #1697 from ananace/add-puppet-languageserver
puppet: Add puppet-languageserver linter
Diffstat (limited to 'test')
-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(''))