1
0
Fork 0
mirror of synced 2024-07-02 21:41:09 -04:00
ultimate-vim/sources_non_forked/vim-ruby/spec/indent/end_constructs_spec.rb
201341 cc444efe2c Revert "Merge pull request #1 from 201341/swj/dev"
This reverts commit f93aa0fb39, reversing
changes made to e13b2a10a7.
2021-10-27 11:36:39 +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