Skip to content

Commit

Permalink
Merge branch 'remove-thread-join-stubbing' of https://github.com/eric…
Browse files Browse the repository at this point in the history
…/god into eric-remove-thread-join-stubbing
  • Loading branch information
mojombo committed Dec 17, 2011
2 parents 12e2621 + de28ea5 commit a38c54d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 6 additions & 3 deletions lib/god.rb
Expand Up @@ -678,10 +678,12 @@ def self.start
sleep 60
end
end

self.main.join
end


def self.join
self.main.join if self.main
end

def self.version
God::VERSION
end
Expand All @@ -691,6 +693,7 @@ def self.version
# Returns nothing
def self.at_exit
self.start
self.join
end

# private
Expand Down
5 changes: 0 additions & 5 deletions test/test_god.rb
Expand Up @@ -5,7 +5,6 @@ def setup
God::Socket.stubs(:new).returns(true)
God.stubs(:setup).returns(true)
God.stubs(:validater).returns(true)
Thread.any_instance.stubs(:join).returns(true)
God.reset
God.pid_file_directory = '/var/run/god'
end
Expand Down Expand Up @@ -273,7 +272,6 @@ def test_control_should_monitor_on_start
w = God.watches['foo']
w.expects(:monitor)
God.control('foo', 'start')
Thread.pass
end

def test_control_should_move_to_restart_on_restart
Expand All @@ -282,7 +280,6 @@ def test_control_should_move_to_restart_on_restart
w = God.watches['foo']
w.expects(:move).with(:restart)
God.control('foo', 'restart')
Thread.pass
end

def test_control_should_unmonitor_and_stop_on_stop
Expand All @@ -293,7 +290,6 @@ def test_control_should_unmonitor_and_stop_on_stop
w.expects(:unmonitor).returns(w)
w.expects(:action).with(:stop)
God.control('foo', 'stop')
Thread.pass
end

def test_control_should_unmonitor_on_unmonitor
Expand All @@ -303,7 +299,6 @@ def test_control_should_unmonitor_on_unmonitor
w.state = :up
w.expects(:unmonitor).returns(w)
God.control('foo', 'unmonitor')
Thread.pass
end

def test_control_should_unwatch_on_remove
Expand Down

0 comments on commit a38c54d

Please sign in to comment.