Set timeout on test cases

This commit is contained in:
Adam Stankiewicz 2013-12-27 00:06:18 +01:00
parent d330fdc01b
commit 6b8c72637f

View File

@ -1,5 +1,5 @@
require 'spec_helper' require 'spec_helper'
require 'tempfile' require 'timeout'
describe "My Vim plugin" do describe "My Vim plugin" do
@ -10,8 +10,8 @@ describe "My Vim plugin" do
extensions = extensions.split(/[\n,]/) extensions = extensions.split(/[\n,]/)
extensions.each do |ext| extensions.each do |ext|
unless ext.match(/styl(us)?$/)
it "should parse #{ext} file" do it "should parse #{ext} file" do
Timeout::timeout(5) do
write_file "#{ext}", "" write_file "#{ext}", ""
vim.edit "#{ext}" vim.edit "#{ext}"
vim.insert "sample" vim.insert "sample"