]> git.madduck.net Git - etc/vim.git/blob - test/fixers/test_standardrb_fixer_callback.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / fixers / test_standardrb_fixer_callback.vader
1 Before:
2   Save g:ale_ruby_standardrb_executable
3   Save g:ale_ruby_standardrb_options
4
5   " Use an invalid global executable, so we don't match it.
6   let g:ale_ruby_standardrb_executable = 'xxxinvalid'
7   let g:ale_ruby_standardrb_options = ''
8
9   call ale#test#SetDirectory('/testplugin/test/fixers')
10
11 After:
12   Restore
13
14   call ale#test#RestoreDirectory()
15
16 Execute(The standardrb callback should return the correct default values):
17   call ale#test#SetFilename('../test-files/ruby/dummy.rb')
18
19   AssertEqual
20   \ {
21   \   'process_with': 'ale#fixers#rubocop#PostProcess',
22   \   'command': ale#Escape(g:ale_ruby_standardrb_executable)
23   \     . ' --fix --force-exclusion --stdin %s',
24   \ },
25   \ ale#fixers#standardrb#Fix(bufnr(''))
26
27 Execute(The standardrb callback should include configuration files):
28   call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
29
30   AssertEqual
31   \ {
32   \   'process_with': 'ale#fixers#rubocop#PostProcess',
33   \   'command': ale#Escape(g:ale_ruby_standardrb_executable)
34   \     . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.standard.yml'))
35   \     . ' --fix --force-exclusion --stdin %s',
36   \ },
37   \ ale#fixers#standardrb#Fix(bufnr(''))
38
39 Execute(The standardrb callback should include custom rubocop options):
40   let g:ale_ruby_standardrb_options = '--except Lint/Debugger'
41   call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
42
43   AssertEqual
44   \ {
45   \   'process_with': 'ale#fixers#rubocop#PostProcess',
46   \   'command': ale#Escape(g:ale_ruby_standardrb_executable)
47   \     . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/with_config/.standard.yml'))
48   \     . ' --except Lint/Debugger'
49   \     . ' --fix --force-exclusion --stdin %s',
50   \ },
51   \ ale#fixers#standardrb#Fix(bufnr(''))