summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Olofsson <alexander.olofsson@liu.se>2018-07-05 21:17:14 +0200
committerAlexander Olofsson <alexander.olofsson@liu.se>2018-07-05 21:25:03 +0200
commit9ca133feb0a97785aa5a3a2aa27763e385d6b47c (patch)
tree7adde2c53e8059a5fd447431ab99fc1d24182f9f /test
parent42ae06a288e3775261847081a6934bc991abd106 (diff)
downloadale-9ca133feb0a97785aa5a3a2aa27763e385d6b47c.zip
Start of vader tests for puppet root detection
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(''))