mirror of
https://github.com/amix/vimrc
synced 2025-06-23 15:04:59 +08:00
Added and updated some plugins
Added: vim-ruby, typescript-vim, vim-javascript Updated: rust-vim
This commit is contained in:
40
sources_non_forked/vim-ruby/spec/spec_helper.rb
Normal file
40
sources_non_forked/vim-ruby/spec/spec_helper.rb
Normal file
@ -0,0 +1,40 @@
|
||||
require 'vimrunner'
|
||||
require 'vimrunner/rspec'
|
||||
|
||||
Vimrunner::RSpec.configure do |config|
|
||||
config.reuse_server = true
|
||||
|
||||
config.start_vim do
|
||||
vim = Vimrunner.start_gvim
|
||||
vim.prepend_runtimepath(File.expand_path('../..', __FILE__))
|
||||
vim.add_plugin(File.expand_path('../vim', __FILE__), 'plugin/syntax_test.vim')
|
||||
vim.set 'expandtab'
|
||||
vim.set 'shiftwidth', 2
|
||||
vim
|
||||
end
|
||||
|
||||
def assert_correct_indenting(extension='rb', string)
|
||||
filename = "test.#{extension}"
|
||||
|
||||
IO.write filename, string
|
||||
|
||||
vim.edit filename
|
||||
vim.normal 'gg=G'
|
||||
vim.write
|
||||
|
||||
expect(IO.read(filename)).to eq string
|
||||
end
|
||||
|
||||
def assert_correct_highlighting(extension='rb', string, patterns, group)
|
||||
filename = "test.#{extension}"
|
||||
|
||||
IO.write filename, string
|
||||
|
||||
vim.edit filename
|
||||
|
||||
Array(patterns).each do |pattern|
|
||||
# TODO: add a custom matcher
|
||||
expect(vim.echo("TestSyntax('#{pattern}', '#{group}')")).to eq '1'
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user