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

28 lines
466 B
Ruby

module Support
module Vim
def set_file_contents(string)
write_file(filename, string)
vim.edit!(filename)
end
def split
vim.command 'normal gS'
vim.write
end
def join
vim.command 'normal gJ'
vim.write
end
def remove_indentation
vim.command '%s/^\s\+//g'
vim.write
end
def assert_file_contents(string)
expect(IO.read(filename).strip).to eq(string.strip)
end
end
end