spec/lite_spec_helper.rb in mongo-2.14.1 vs spec/lite_spec_helper.rb in mongo-2.15.0.alpha
- old
+ new
@@ -67,10 +67,14 @@
unless SpecConfig.instance.client_debug?
Mongo::Logger.logger.level = Logger::INFO
end
Encoding.default_external = Encoding::UTF_8
+module Mrss
+ autoload :Utils, 'mrss/utils'
+end
+
require 'mrss/lite_constraints'
require 'support/matchers'
require 'support/event_subscriber'
require 'support/common_shortcuts'
require 'support/client_registry'
@@ -86,10 +90,12 @@
else
require 'timeout'
TimeoutInterrupt = Timeout
end
+class ExampleTimeout < StandardError; end
+
RSpec.configure do |config|
config.extend(CommonShortcuts::ClassMethods)
config.include(CommonShortcuts::InstanceMethods)
config.extend(Mrss::LiteConstraints)
config.include(ClientRegistryMacros)
@@ -116,10 +122,10 @@
timeout = if %w(1 true yes).include?(ENV['STRESS']&.downcase)
210
else
45
end
- TimeoutInterrupt.timeout(timeout) do
+ TimeoutInterrupt.timeout(timeout, ExampleTimeout) do
example.run
end
end
end