summaryrefslogtreecommitdiff
path: root/test/linter/test_sass_sasslint.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/linter/test_sass_sasslint.vader')
-rw-r--r--test/linter/test_sass_sasslint.vader43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/linter/test_sass_sasslint.vader b/test/linter/test_sass_sasslint.vader
new file mode 100644
index 00000000..87f0c8ad
--- /dev/null
+++ b/test/linter/test_sass_sasslint.vader
@@ -0,0 +1,43 @@
+Before:
+ call ale#assert#SetUpLinterTest('sass', 'sasslint')
+ call ale#test#SetFilename('test.sass')
+ unlet! b:executable
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(should default to source, bin/sass-lint.js):
+ call ale#test#SetFilename('../test-files/sasslint/with-source/test.sass')
+
+ let b:executable = ale#path#Simplify(
+ \ g:dir
+ \ . '/../test-files/sasslint/with-source/node_modules/sass-lint/bin/sass-lint.js'
+ \)
+
+ AssertLinter b:executable,
+ \ (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(b:executable)
+ \ . ' -v -q -f compact %t'
+
+Execute(should fallback to bin, .bin/sass-lint):
+ call ale#test#SetFilename('../test-files/sasslint/with-bin/test.sass')
+
+ let b:executable = ale#path#Simplify(
+ \ g:dir
+ \ . '/../test-files/sasslint/with-bin/node_modules/.bin/sass-lint'
+ \)
+
+ AssertLinter b:executable, ale#Escape(b:executable) . ' -v -q -f compact %t'
+
+Execute(should fallback to global bin):
+ AssertLinter 'sass-lint', ale#Escape('sass-lint') . ' -v -q -f compact %t'
+
+Execute(The global executable should be configurable):
+ let b:ale_sass_sasslint_executable = 'foo'
+
+ AssertLinter 'foo', ale#Escape('foo') . ' -v -q -f compact %t'
+
+Execute(The options should be configurable):
+ let b:ale_sass_sasslint_options = '--bar'
+
+ AssertLinter 'sass-lint', ale#Escape('sass-lint') . ' --bar -v -q -f compact %t'