1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 03:00:06 +08:00
SpaceVim/bundle/vim-ruby/spec/indent/end_constructs_spec.rb
2022-05-28 19:32:08 +08:00

47 lines
840 B
Ruby

require 'spec_helper'
describe "Indenting" do
specify "end constructs" do
assert_correct_indenting <<~EOF
f do
g { def h; end }
end
EOF
assert_correct_indenting <<~EOF
if foo
bar ; end
something_else
EOF
assert_correct_indenting <<~EOF
if bar ; end
something_else
EOF
assert_correct_indenting <<~EOF
foo do
foo = 3 . class
foo = lambda { class One; end }
foo = lambda { |args| class One; end }
foo = bar; class One; end
end
EOF
assert_correct_indenting <<~EOF
nested do
while true do
def foo
if bar
for i in collection
def baz
end
end
end
end
end
end
EOF
end
end