Register the watch's process at the end of meddle.
[god.git] / test / test_god.rb
blob8fdcf4ce56d9dc12a6a4e76453c6368f350b73d2
1 require File.dirname(__FILE__) + '/helper'
3 class TestGod < Test::Unit::TestCase
4   def test_should_create_new_meddle
5     Meddle.expects(:new).with(:port => 1).returns(mock(:monitor => true))
6     Timer.expects(:get).returns(stub(:join => nil)).times(2)
7     
8     God.meddle(:port => 1) {}
9   end
11   def test_should_start_monitoring
12     Meddle.any_instance.expects(:monitor)
13     Timer.expects(:get).returns(stub(:join => nil)).times(2)
14     God.meddle(:port => 9999) {}
15   end
16 end