summaryrefslogtreecommitdiff
path: root/test/fixers/test_rubyfmt_fixer_callback.vader
blob: e211640ff2105073c74fc05ce23e526f66afc42a (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
Before:
  Save g:ale_ruby_rubyfmt_executable
  Save g:ale_ruby_rubyfmt_options
  Save &l:expandtab
  Save &l:shiftwidth
  Save &l:tabstop

After:
  Restore

Execute(The rubyfmt callback should return 'rubyfmt' as default command):
  setlocal noexpandtab
  Assert
  \ ale#fixers#rubyfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('rubyfmt'),
  \ "Default command name is expected to be 'rubyfmt'"

Execute(The ruby executable and options should be configurable):
  let g:ale_ruby_rubyfmt_executable = 'foobar'
  let g:ale_ruby_rubyfmt_options = '--some-option'

  AssertEqual
  \ {
  \   'command': ale#Escape('foobar')
  \     . ' --some-option',
  \ },
  \ ale#fixers#rubyfmt#Fix(bufnr(''))