Permalink
Browse files

Shutdown using at_exit

  • Loading branch information...
1 parent 29a5336 commit bc53301408bd4ba42e8efda04a0c53a9448a93e8 @ileitch committed Dec 20, 2012
Showing with 3 additions and 0 deletions.
  1. +2 −0 lib/rapns/embed.rb
  2. +1 −0 spec/unit/embed_spec.rb
View
@@ -7,6 +7,8 @@ def self.embed(options = {})
config.embedded = true
Rapns.config.update(config)
Rapns::Daemon.start
+
+ Kernel.at_exit { shutdown }
end
def self.shutdown
@@ -3,6 +3,7 @@
describe Rapns, 'embed' do
before do
Rapns::Daemon.stub(:start)
+ Kernel.stub(:at_exit)
end
it 'sets the embedded config option to true' do

0 comments on commit bc53301

Please sign in to comment.