]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_rails_best_practices.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:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / linter / test_rails_best_practices.vader
1 Before:
2   call ale#assert#SetUpLinterTest('ruby', 'rails_best_practices')
3   call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
4
5   let b:args = '--silent -f json'
6   \ . ' --output-file ' . (has('win32') ? '%t' : '/dev/stdout')
7   let b:app_path = ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app')
8   let b:suffix = has('win32') ? '; type %t' : ''
9
10 After:
11   unlet! b:args
12   unlet! b:app_path
13   unlet! b:suffix
14   call ale#assert#TearDownLinterTest()
15
16 Execute(Executable should default to rails_best_practices):
17   AssertLinter 'rails_best_practices', ale#Escape('rails_best_practices')
18   \   . ' ' . b:args
19   \   . ' ' . ale#Escape(b:app_path)
20   \   . b:suffix
21
22 Execute(Should be able to set a custom executable):
23   let g:ale_ruby_rails_best_practices_executable = 'bin/rails_best_practices'
24
25   AssertLinter 'bin/rails_best_practices', ale#Escape('bin/rails_best_practices')
26   \   . ' ' . b:args
27   \   . ' ' . ale#Escape(b:app_path)
28   \   . b:suffix
29
30 Execute(Setting bundle appends 'exec rails_best_practices'):
31   let g:ale_ruby_rails_best_practices_executable = 'path to/bundle'
32
33   AssertLinter 'path to/bundle', ale#Escape('path to/bundle')
34   \   . ' exec rails_best_practices'
35   \   . ' ' . b:args
36   \   . ' ' . ale#Escape(b:app_path)
37   \   . b:suffix
38
39 Execute(Command callback should be empty when not in a valid Rails app):
40   call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/test.rb')
41
42   AssertLinter 'rails_best_practices', ''