Skip to content

Instantly share code, notes, and snippets.

@grantr
Last active December 11, 2015 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantr/4567392 to your computer and use it in GitHub Desktop.
Save grantr/4567392 to your computer and use it in GitHub Desktop.
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