Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cpetschnig/485698 to your computer and use it in GitHub Desktop.
Save cpetschnig/485698 to your computer and use it in GitHub Desktop.
From d775b59b47c284fe43086772cffe7481b951d36a Mon Sep 17 00:00:00 2001
From: Christoph Petschnig <[email protected]>
Date: Thu, 22 Jul 2010 08:21:35 +0200
Subject: [PATCH] Added tests for start/stop log messages
---
test/daemon_spawn_test.rb | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/test/daemon_spawn_test.rb b/test/daemon_spawn_test.rb
index 14eccea..7e7dc31 100644
--- a/test/daemon_spawn_test.rb
+++ b/test/daemon_spawn_test.rb
@@ -99,4 +99,18 @@ class DaemonSpawnTest < Test::Unit::TestCase
end
end
+ # check the log file to see, if start and stop messages were written
+ def test_start_stop_messages
+ port = 5150
+ Dir.chdir(SERVERS) do
+ echo_server 'start', port
+ sleep 1
+ echo_server 'stop'
+
+ lines = open('/tmp/echo_server.log').readlines
+ assert_equal lines[-2], "EchoServer started on port #{port}\n"
+ assert_equal lines[-1], "Stopping EchoServer...\n"
+ end
+ end
+
end
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment