test/biobot/test_base.rb in viking-biobot-0.0.3 vs test/biobot/test_base.rb in viking-biobot-0.0.4
- old
+ new
@@ -75,13 +75,14 @@
# biobot.process(incoming)
# end
def test_timers_for_periodicals_on_start
clear_periodicals
- Biobot::Base.register_periodical(:leetsaurus, 0.3)
- Thread.expects(:new).once
- Biobot::Base.new(@config).start
+ Biobot::Base.register_periodical(:leetsaurus, 10)
+ biobot = Biobot::Base.new(@config)
+ biobot.expects(:leetsaurus)
+ biobot.start
end
def test_active_record_usage
@config['database'] = {
"adapter" => "sqlite3",
@@ -93,8 +94,20 @@
end
def test_stop
@client.expects(:close!)
biobot = Biobot::Base.new(@config)
+ biobot.start
biobot.stop
+ end
+
+ def test_logger
+ Logger.expects(:new).with('biobot.log')
+ @config['logfile'] = 'biobot.log'
+ biobot = Biobot::Base.new(@config)
+ end
+
+ def test_nil_logger
+ Logger.expects(:new).never
+ biobot = Biobot::Base.new(@config)
end
end