Skip to content
Browse files

Test Bot daemonize option.

  • Loading branch information...
1 parent 5558154 commit 401665df3c08751db4d83c7249a176504a41b704 @bitbckt committed Aug 28, 2009
Showing with 28 additions and 0 deletions.
  1. +28 −0 spec/bot_spec.rb
View
28 spec/bot_spec.rb
@@ -0,0 +1,28 @@
+require File.dirname(__FILE__) + '/spec_helper'
+
+describe Botbckt::Bot, 'start' do
+
+ describe 'daemonizes' do
+
+ before(:each) do
+ EM.should_receive(:fork_reactor)
+ end
+
+ it 'when options[:daemonize] is undefined' do
+ Botbckt::Bot.start({})
+ end
+
+ it 'when options[:daemonize] is true' do
+ Botbckt::Bot.start :daemonize => true
+ end
+
+ end
+
+ it 'does not daemonize when options[:daemonize] is false' do
+ EM.should_receive(:run)
+ EM.should_not_receive(:fork_reactor)
+ Botbckt::Bot.start :daemonize => false
+ end
+
+end
+

0 comments on commit 401665d

Please sign in to comment.
Something went wrong with that request. Please try again.