summaryrefslogblamecommitdiffstats
path: root/spec/loading_spec.rb
blob: e9e1f3b8302e69fe57cd5e1429ffbce0cec627c6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                     
                 

                           
 





                                                                                                                                         
                                      
                                






                                      
         

       



                
   
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.sort!.uniq!.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

  after(:all) do
    vim.kill
  end
end