Test all possible file extensions, fixes #7
This commit is contained in:
parent
ab679f37dd
commit
56d5fc498b
@ -1,12 +1,18 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
require 'tempfile'
|
||||||
|
|
||||||
describe "My Vim plugin" do
|
describe "My Vim plugin" do
|
||||||
languages = Dir["#{$plugin_path}/syntax/*.vim"].map { |f| f.split('/').last.gsub('.vim', '') }
|
|
||||||
|
|
||||||
languages.each do |lang|
|
extensions = `cat ftdetect/polyglot.vim | grep '^au' | tr "\t" ' ' | cut -d ' ' -f 3 | grep -v / | grep -v '^\*$' | grep -v '^$'`.strip
|
||||||
it "should parse .#{lang} file" do
|
|
||||||
write_file "test.#{lang}", ""
|
extensions.gsub!(/\[(.).+\]/) { $1 }.gsub!('*', 'test')
|
||||||
vim.edit "test.#{lang}"
|
|
||||||
|
extensions = extensions.split(/[\n,]/)
|
||||||
|
|
||||||
|
extensions.each do |ext|
|
||||||
|
it "should parse #{ext} file" do
|
||||||
|
write_file "#{ext}", ""
|
||||||
|
vim.edit "#{ext}"
|
||||||
vim.insert "sample"
|
vim.insert "sample"
|
||||||
vim.write
|
vim.write
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user