1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 09:50:04 +08:00
SpaceVim/bundle/splitjoin.vim/spec/plugin/eruby_spec.rb
2024-06-27 18:10:36 +08:00

40 lines
765 B
Ruby

require 'spec_helper'
describe "eruby" do
let(:filename) { 'test.erb' }
before :each do
vim.set(:expandtab)
vim.set(:shiftwidth, 2)
end
after :each do
vim.command('silent! unlet g:splitjoin_ruby_trailing_comma')
end
specify "method options with a trailing comma" do
vim.command('let g:splitjoin_ruby_trailing_comma = 1')
set_file_contents <<~EOF
<%= link_to "Home", "/", remote: true, confirm: "Y?" %>
EOF
vim.search 'Home'
split
assert_file_contents <<~EOF
<%= link_to "Home", "/", {
remote: true,
confirm: "Y?",
} %>
EOF
vim.search 'Home'
join
assert_file_contents <<~EOF
<%= link_to "Home", "/", { remote: true, confirm: "Y?" } %>
EOF
end
end