Permalink
Browse files

starting redis server for tests

  • Loading branch information...
1 parent 14a451b commit ddebe687f5ce9680f20fd5d2939d9e461d5f1c79 @tenderlove committed Jul 20, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 test/observable/test_redis.rb
@@ -65,3 +65,20 @@ def observer_module
end
end
end
+
+Dir.chdir(File.join(File.dirname(__FILE__), '..')) do
+ `redis-server redis-test.conf`
+end
+
+at_exit {
+ next if $!
+
+ exit_code = MiniTest::Unit.new.run(ARGV)
+
+ processes = `ps -A -o pid,command | grep [r]edis-test`.split("\n")
+ pids = processes.map { |process| process.split(" ")[0] }
+ puts "Killing test redis server..."
+ pids.each { |pid| Process.kill("KILL", pid.to_i) }
+
+ exit exit_code
+}

0 comments on commit ddebe68

Please sign in to comment.