1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#require "bundler/setup"
#if ENV["REPORT_COVERAGE"]
# require "coveralls"
# Coveralls.wear!
#end
require "fileutils"
require "msgpack"
require "neovim"
#require "pry"
require "rubygems"
require "securerandom"
require "stringio"
require "timeout"
require File.expand_path("../support.rb", __FILE__)
RSpec.configure do |config|
config.expect_with :rspec do |exp|
exp.syntax = :expect
end
config.disable_monkey_patching!
config.order = :random
config.color = true
config.around(:example, :silence_thread_exceptions) do |spec|
if Thread.respond_to?(:report_on_exception)
original = Thread.report_on_exception
begin
Thread.report_on_exception = false
spec.run
ensure
Thread.report_on_exception = original
end
else
spec.run
end
end
config.around(:example) do |spec|
Support.setup_workspace
timeout = spec.metadata.fetch(:timeout, 3)
begin
Timeout.timeout(timeout) { spec.run }
ensure
Support.teardown_workspace
end
end
Kernel.srand config.seed
end
Thread.abort_on_exception = true
|