summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-03-29 00:56:39 +0100
committerw0rp <devw0rp@gmail.com>2017-03-29 00:56:39 +0100
commit2a88b60ff1ef5a4e9e73dc0d3be9f8ac51ec1309 (patch)
tree16f02c0765ba7ce341c5a591dd5e5f635181b32e /test
parent8e71f233da6c45c03c216b7fab2919d1c512c6dc (diff)
downloadale-2a88b60ff1ef5a4e9e73dc0d3be9f8ac51ec1309.zip
Fix #260 automatically set .csslintrc files from ancestor directories
Diffstat (limited to 'test')
-rw-r--r--test/csslint-test-files/other-app/testfile.css0
-rw-r--r--test/csslint-test-files/some-app/.csslintrc0
-rw-r--r--test/csslint-test-files/some-app/subdir/testfile.css0
-rw-r--r--test/test_csslint_config_detection.vader36
4 files changed, 36 insertions, 0 deletions
diff --git a/test/csslint-test-files/other-app/testfile.css b/test/csslint-test-files/other-app/testfile.css
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/csslint-test-files/other-app/testfile.css
diff --git a/test/csslint-test-files/some-app/.csslintrc b/test/csslint-test-files/some-app/.csslintrc
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/csslint-test-files/some-app/.csslintrc
diff --git a/test/csslint-test-files/some-app/subdir/testfile.css b/test/csslint-test-files/some-app/subdir/testfile.css
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/csslint-test-files/some-app/subdir/testfile.css
diff --git a/test/test_csslint_config_detection.vader b/test/test_csslint_config_detection.vader
new file mode 100644
index 00000000..a06258ca
--- /dev/null
+++ b/test/test_csslint_config_detection.vader
@@ -0,0 +1,36 @@
+Before:
+ silent! cd /testplugin/test
+ let g:dir = getcwd()
+
+ runtime ale_linters/css/csslint.vim
+
+After:
+ silent execute 'cd ' . g:dir
+ unlet! g:dir
+
+ call ale#linter#Reset()
+
+Execute(--config should be set when the .csslintrc file is found):
+ new csslint-test-files/some-app/subdir/testfile.js
+
+ AssertEqual
+ \ (
+ \ 'csslint --format=compact '
+ \ . '--config=' . fnameescape(g:dir . '/csslint-test-files/some-app/.csslintrc')
+ \ . ' %t'
+ \ ),
+ \ ale_linters#css#csslint#GetCommand(bufnr(''))
+
+ :q
+
+Execute(--config should not be used when no .csslintrc file exists):
+ new csslint-test-files/other-app/testfile.css
+
+ AssertEqual
+ \ (
+ \ 'csslint --format=compact '
+ \ . ' %t'
+ \ ),
+ \ ale_linters#css#csslint#GetCommand(bufnr(''))
+
+ :q