spec/spec_helper.rb in celluloid-zmq-0.16.1 vs spec/spec_helper.rb in celluloid-zmq-0.17.0
- old
+ new
@@ -1,11 +1,29 @@
require 'coveralls'
Coveralls.wear!
+require 'rubygems'
require 'bundler/setup'
require 'celluloid/zmq'
+require 'celluloid/rspec'
+module CelluloidSpecs
+ # Require a file from Celluloid gem 'spec' location directly
+ def self.require(path)
+ celluloid = Pathname(Gem::Specification.find_all_by_name('celluloid').first.full_gem_path)
+ full_path = celluloid + 'spec' + path
+ Kernel.require(full_path.to_s)
+ end
+
+ def self.included_module
+ Celluloid::ZMQ
+ end
+
+ # Timer accuracy enforced by the tests (50ms)
+ TIMER_QUANTUM = 0.05
+end
+
logfile = File.open(File.expand_path("../../log/test.log", __FILE__), 'a')
Celluloid.logger = Logger.new(logfile)
Celluloid.shutdown_timeout = 1
@@ -16,7 +34,12 @@
Celluloid::ZMQ.init(1) unless ex.metadata[:no_init]
Celluloid.boot
ex.run
Celluloid.shutdown
Celluloid::ZMQ.terminate
+ end
+
+ config.before(:each) do |example|
+ @fake_logger = Specs::FakeLogger.new(Celluloid.logger, example.description)
+ stub_const('Celluloid::Internals::Logger', @fake_logger)
end
end