vim-polyglot/spec/loading_spec.rb
Adam Stankiewicz 8b3a563bd0 Fix regexp
2019-03-10 19:11:11 +01:00

25 lines
593 B
Ruby

require 'spec_helper'
require 'timeout'
describe "My Vim plugin" do
extensions = `cat ftdetect/polyglot.vim | grep '^au' | tr "\t" ' ' | cut -d ' ' -f 3 | grep -v / | grep -v '^\*$' | grep -v '^$'`.strip
extensions.gsub!(/\[(.).+\]/) { $1 }.gsub!('*', 'test')
extensions = extensions.split(/[\n,]/)
extensions.each do |ext|
if ext.match?(/^[a-z\.]+$/i)
it "should parse #{ext} file" do
Timeout::timeout(20) do
write_file "#{ext}", ""
vim.edit "#{ext}"
vim.insert "sample"
vim.write
end
end
end
end
end