summaryrefslogtreecommitdiff
path: root/test/fixers/test_buildifier_fixer_callback.vader
blob: db9f1e55e066f6b9c170aec5603197a782349714 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Before:
  let g:ale_bazel_buildifier_options = ''
  call ale#assert#SetUpFixerTest('bzl', 'buildifier')

After:
  call ale#assert#TearDownFixerTest()

Execute(The buildifier callback should return the correct default values):
  call ale#test#SetFilename('../test-files/bazel/WORKSPACE')

  AssertFixer
  \ {
  \   'command': ale#Escape(g:ale_bazel_buildifier_executable)
  \     . ' -mode fix -lint fix -type workspace -'
  \ }

Execute(The buildifier callback should include any additional options):
  call ale#test#SetFilename('../test-files/bazel/WORKSPACE')
  let g:ale_bazel_buildifier_options = '--some-option'

  AssertFixer
  \ {
  \   'command': ale#Escape(g:ale_bazel_buildifier_executable)
  \     . ' -mode fix -lint fix -type workspace --some-option -',
  \ }

Execute(The buildifier callback should recognize BUILD files):
  call ale#test#SetFilename('../test-files/bazel/BUILD')

  AssertFixer
  \ {
  \   'command': ale#Escape(g:ale_bazel_buildifier_executable)
  \     . ' -mode fix -lint fix -type build -'
  \ }

Execute(The buildifier callback should recognize .bzl files):
  call ale#test#SetFilename('../test-files/bazel/defs.bzl')

  AssertFixer
  \ {
  \   'command': ale#Escape(g:ale_bazel_buildifier_executable)
  \     . ' -mode fix -lint fix -type bzl -'
  \ }