summaryrefslogtreecommitdiff
path: root/test/test_csslint_config_detection.vader
blob: c8e5fa98a98967966250d4baeb1e895f98afb8a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Before:
  call ale#test#SetDirectory('/testplugin/test')

  runtime ale_linters/css/csslint.vim

After:
  call ale#test#RestoreDirectory()
  call ale#linter#Reset()

Execute(--config should be set when the .csslintrc file is found):
  call ale#test#SetFilename('test-files/csslint/some-app/subdir/testfile.js')

  AssertEqual
  \ (
  \   'csslint --format=compact '
  \   . '--config=' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/csslint/some-app/.csslintrc'))
  \   . ' %t'
  \ ),
  \ ale_linters#css#csslint#GetCommand(bufnr(''))

Execute(--config should not be used when no .csslintrc file exists):
  call ale#test#SetFilename('test-files/csslint/other-app/testfile.css')

  AssertEqual
  \ (
  \   'csslint --format=compact '
  \   . ' %t'
  \ ),
  \ ale_linters#css#csslint#GetCommand(bufnr(''))