Skip to content

Instantly share code, notes, and snippets.

@grantr grantr/spec_helper.rb
Last active Dec 11, 2015

Embed
What would you like to do?
kill new actors in specs
RSpec.configure do |config|
# terminate actors created during tests
config.before(:each) do
@running_actors = Celluloid::Actor.all
end
config.after(:each) do
new_actors = Celluloid::Actor.all - @running_actors
new_actors.each { |a| a.terminate if a.alive? }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.