diff options
author | Alexander Olofsson <alexander.olofsson@liu.se> | 2018-07-05 21:17:14 +0200 |
---|---|---|
committer | Alexander Olofsson <alexander.olofsson@liu.se> | 2018-07-05 21:25:03 +0200 |
commit | 9ca133feb0a97785aa5a3a2aa27763e385d6b47c (patch) | |
tree | 7adde2c53e8059a5fd447431ab99fc1d24182f9f /test | |
parent | 42ae06a288e3775261847081a6934bc991abd106 (diff) | |
download | ale-9ca133feb0a97785aa5a3a2aa27763e385d6b47c.zip |
Start of vader tests for puppet root detection
Diffstat (limited to 'test')
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('')) |