2023-06-12 09:54:30 -06:00
|
|
|
local Runner = require('tests.indent.common').Runner
|
2022-07-09 16:58:25 +08:00
|
|
|
|
2023-06-12 09:54:30 -06:00
|
|
|
local run = Runner:new(it, 'tests/indent/ruby', {
|
2022-07-09 16:58:25 +08:00
|
|
|
shiftwidth = 2,
|
|
|
|
|
expandtab = true,
|
|
|
|
|
})
|
|
|
|
|
|
2023-06-12 09:54:30 -06:00
|
|
|
describe('indent Ruby:', function()
|
|
|
|
|
describe('whole file:', function()
|
|
|
|
|
run:whole_file('.', {
|
|
|
|
|
expected_failures = { './period-issue-3364.rb' },
|
2022-08-13 16:56:02 +08:00
|
|
|
})
|
|
|
|
|
end)
|
|
|
|
|
|
2023-06-12 09:54:30 -06:00
|
|
|
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 })
|
2022-07-09 16:58:25 +08:00
|
|
|
end)
|
|
|
|
|
end)
|