1
0
mirror of https://github.com/amix/vimrc synced 2025-07-09 10:45:00 +08:00

Cleaning deps.

This commit is contained in:
Maksim Pecherskiy
2014-08-07 19:42:41 -04:00
parent 4541dd93ef
commit 2deb035254
266 changed files with 26588 additions and 31 deletions

View File

@ -0,0 +1,44 @@
require 'tmpdir'
require 'vimrunner'
module Support
def assert_correct_indenting(string)
whitespace = string.scan(/^\s*/).first
string = string.split("\n").map { |line| line.gsub /^#{whitespace}/, '' }.join("\n").strip
File.open 'test.rb', 'w' do |f|
f.write string
end
@vim.edit 'test.rb'
@vim.normal 'gg=G'
@vim.write
IO.read('test.rb').strip.should eq string
end
end
RSpec.configure do |config|
include Support
config.before(:suite) do
VIM = Vimrunner.start_gvim
VIM.prepend_runtimepath(File.expand_path('../..', __FILE__))
end
config.after(:suite) do
VIM.kill
end
config.around(:each) do |example|
@vim = VIM
# cd into a temporary directory for every example.
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
@vim.command("cd #{dir}")
example.call
end
end
end
end