aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/ruby_spec.lua
blob: 4dcd4d0fa8f68787ba813c278df0f5e29cf5fb0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local Runner = require('tests.indent.common').Runner

local run = Runner:new(it, 'tests/indent/ruby', {
  shiftwidth = 2,
  expandtab = true,
})

describe('indent Ruby:', function()
  describe('whole file:', function()
    run:whole_file('.', {
      expected_failures = { './period-issue-3364.rb' },
    })
  end)

  describe('new line:', function()
    run:new_line('indent-unless.rb', { on_line = 1, text = 'stmt', indent = 2 })
    run:new_line('indent-assignment.rb', { on_line = 1, text = '1 +', indent = 2 })
    run:new_line('indent-parenthesized-statements.rb', { on_line = 1, text = 'stmt', indent = 2 })
    run:new_line('indent-rescue.rb', { on_line = 1, text = 'rescue', indent = 0 })
    run:new_line('indent-ensure.rb', { on_line = 1, text = 'ensure', indent = 0 })
  end)
end)