summaryrefslogtreecommitdiff
path: root/test/command_callback/test_less_stylelint_command_callback.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/command_callback/test_less_stylelint_command_callback.vader')
-rw-r--r--test/command_callback/test_less_stylelint_command_callback.vader41
1 files changed, 6 insertions, 35 deletions
diff --git a/test/command_callback/test_less_stylelint_command_callback.vader b/test/command_callback/test_less_stylelint_command_callback.vader
index a5912ecf..8d23deb6 100644
--- a/test/command_callback/test_less_stylelint_command_callback.vader
+++ b/test/command_callback/test_less_stylelint_command_callback.vader
@@ -1,31 +1,10 @@
Before:
- Save g:ale_less_stylelint_executable
- Save g:ale_less_stylelint_use_global
- Save g:ale_less_stylelint_options
-
+ call ale#assert#SetUpLinterTest('less', 'stylelint')
unlet! b:executable
- unlet! g:ale_less_stylelint_executable
- unlet! g:ale_less_stylelint_use_global
- unlet! g:ale_less_stylelint_options
-
- call ale#test#SetDirectory('/testplugin/test/command_callback')
- call ale#test#SetFilename('testfile.less')
-
- runtime ale_linters/less/stylelint.vim
-
After:
- Restore
-
unlet! b:executable
- unlet! b:ale_less_stylelint_executable
- unlet! b:ale_less_stylelint_use_global
- unlet! b:ale_less_stylelint_options
-
- call ale#test#SetFilename('test.txt')
-
- call ale#test#RestoreDirectory()
- call ale#linter#Reset()
+ call ale#assert#TearDownLinterTest()
Execute(node_modules directories should be discovered):
call ale#test#SetFilename('stylelint_paths/nested/testfile.less')
@@ -35,10 +14,7 @@ Execute(node_modules directories should be discovered):
\ . '/stylelint_paths/node_modules/.bin/stylelint'
\)
- AssertEqual b:executable, ale_linters#less#stylelint#GetExecutable(bufnr(''))
- AssertEqual
- \ ale#Escape(b:executable) . ' --stdin-filename %s',
- \ ale_linters#less#stylelint#GetCommand(bufnr(''))
+ AssertLinter b:executable, ale#Escape(b:executable) . ' --stdin-filename %s'
Execute(The global override should work):
let b:ale_less_stylelint_executable = 'foobar'
@@ -46,15 +22,10 @@ Execute(The global override should work):
call ale#test#SetFilename('stylelint_paths/nested/testfile.less')
- AssertEqual 'foobar', ale_linters#less#stylelint#GetExecutable(bufnr(''))
- AssertEqual
- \ ale#Escape('foobar') . ' --stdin-filename %s',
- \ ale_linters#less#stylelint#GetCommand(bufnr(''))
+ AssertLinter 'foobar', ale#Escape('foobar') . ' --stdin-filename %s'
Execute(Extra options should be configurable):
let b:ale_less_stylelint_options = '--whatever'
- AssertEqual 'stylelint', ale_linters#less#stylelint#GetExecutable(bufnr(''))
- AssertEqual
- \ ale#Escape('stylelint') . ' --whatever --stdin-filename %s',
- \ ale_linters#less#stylelint#GetCommand(bufnr(''))
+ AssertLinter 'stylelint',
+ \ ale#Escape('stylelint') . ' --whatever --stdin-filename %s'