5 def assert_correct_indenting(string)
6 whitespace = string.scan(/^\s*/).first
7 string = string.split("\n").map { |line| line.gsub /^#{whitespace}/, '' }.join("\n").strip
9 File.open 'test.rb', 'w' do |f|
17 IO.read('test.rb').strip.should eq string
21 RSpec.configure do |config|
24 config.before(:suite) do
25 VIM = Vimrunner.start_gvim
26 VIM.prepend_runtimepath(File.expand_path('../..', __FILE__))
29 config.after(:suite) do
33 config.around(:each) do |example|
36 # cd into a temporary directory for every example.
39 @vim.command("cd #{dir}")