spec/spec_helper.rb in celluloid-0.15.2 vs spec/spec_helper.rb in celluloid-0.16.0.pre
- old
+ new
@@ -2,30 +2,43 @@
Coveralls.wear!
require 'rubygems'
require 'bundler/setup'
require 'celluloid/rspec'
+require 'celluloid/probe'
logfile = File.open(File.expand_path("../../log/test.log", __FILE__), 'a')
logfile.sync = true
-logger = Celluloid.logger = Logger.new(logfile)
+Celluloid.logger = Logger.new(logfile)
Celluloid.shutdown_timeout = 1
Dir['./spec/support/*.rb'].map {|f| require f }
RSpec.configure do |config|
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
- config.before do
- Celluloid.logger = logger
- if Celluloid.running?
- Celluloid.shutdown
- sleep 0.01
- Celluloid.internal_pool.assert_inactive
+ config.around do |ex|
+ Celluloid.actor_system = nil
+ Thread.list.each do |thread|
+ next if thread == Thread.current
+ thread.kill
end
+ ex.run
+ end
+
+ config.around actor_system: :global do |ex|
Celluloid.boot
+ ex.run
+ Celluloid.shutdown
end
+
+ config.around actor_system: :within do |ex|
+ Celluloid::ActorSystem.new.within do
+ ex.run
+ end
+ end
+
end