Before:
  call ale#assert#SetUpFixerTest('ruby', 'rubocop')

After:
  call ale#assert#TearDownFixerTest()

Execute(The rubocop callback should return the correct default values):
  call ale#test#SetFilename('../test-files/ruby/dummy.rb')

  GivenCommandOutput ['1.61.0']

  AssertFixer
  \ {
  \   'process_with': 'ale#fixers#rubocop#PostProcess',
  \   'command': ale#Escape(g:ale_ruby_rubocop_executable)
  \     . ' --auto-correct --editor-mode --force-exclusion --stdin %s',
  \ }

Execute(The rubocop callback should include custom rubocop options):
  let g:ale_ruby_rubocop_options = '--except Lint/Debugger'
  call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')

  GivenCommandOutput ['1.61.0']

  AssertFixer
  \ {
  \   'process_with': 'ale#fixers#rubocop#PostProcess',
  \   'command': ale#Escape(g:ale_ruby_rubocop_executable)
  \     . ' --except Lint/Debugger'
  \     . ' --auto-correct --editor-mode --force-exclusion --stdin %s',
  \ }

Execute(The rubocop callback should use auto-correct-all option when set):
  let g:ale_ruby_rubocop_auto_correct_all = 1
  call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')

  GivenCommandOutput ['1.61.0']

  AssertFixer
  \ {
  \   'process_with': 'ale#fixers#rubocop#PostProcess',
  \   'command': ale#Escape(g:ale_ruby_rubocop_executable)
  \     . ' --auto-correct-all --editor-mode --force-exclusion --stdin %s'
  \ }

Execute(The rubocop post-processor should remove diagnostics content):
  AssertEqual
  \ [
  \   'class MyModel < ApplicationRecord',
  \   '  # rubocop:disable Rails/InverseOf',
  \   '  has_one :something',
  \   '  # rubocop:enable Rails/InverseOf',
  \   'end',
  \   '',
  \   'array = [1, 2, 3,',
  \   '         4, 5, 6]',
  \   'array = [''run'',',
  \   '         ''forrest'',',
  \   '         ''run'']',
  \ ],
  \ ale#fixers#rubocop#PostProcess(bufnr(''), [
  \   'Inspecting 1 file',
  \   'C',
  \   '',
  \   'Offenses:',
  \   'app/models/my_model.rb:8:3: C: [Corrected] Layout/ArrayAlignment: ',
  \   '4, 5, 6]',
  \   '^',
  \   '',
  \   '1 file inspected, 3 offenses detected, 3 offenses corrected',
  \   '====================',
  \   'class MyModel < ApplicationRecord',
  \   '  # rubocop:disable Rails/InverseOf',
  \   '  has_one :something',
  \   '  # rubocop:enable Rails/InverseOf',
  \   'end',
  \   '',
  \   'array = [1, 2, 3,',
  \   '         4, 5, 6]',
  \   'array = [''run'',',
  \   '         ''forrest'',',
  \   '         ''run'']',
  \ ])

Execute(The rubocop callback should not use editor-mode option with older versions):
  call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')

  GivenCommandOutput ['1.59.0']

  AssertFixer
  \ {
  \   'process_with': 'ale#fixers#rubocop#PostProcess',
  \   'command': ale#Escape(g:ale_ruby_rubocop_executable)
  \     . ' --auto-correct --force-exclusion --stdin %s'
  \ }

