Permalink
Browse files

Add test logging

  • Loading branch information...
1 parent 7c32353 commit 4a5b5f3f6ffc9a1ce598e007bf0ff657f5cc15a5 @sstephenson committed Feb 22, 2010
Showing with 14 additions and 0 deletions.
  1. +1 −0 log/.gitignore
  2. +9 −0 test/lib/hector/test_case.rb
  3. +4 −0 test/test_helper.rb
View
@@ -0,0 +1 @@
+*
@@ -6,6 +6,15 @@ def self.test(name, &block)
define_method("test #{name.inspect}", &block)
end
+ def run_with_logging(result, &block)
+ Hector.logger.info "--- #@method_name ---"
+ run_without_logging(result, &block)
+ Hector.logger.info " "
+ end
+
+ alias_method :run_without_logging, :run
+ alias_method :run, :run_with_logging
+
def connection
Hector::TestConnection.new("test")
end
View
@@ -12,6 +12,10 @@
$:.unshift File.dirname(__FILE__) + "/lib"
+require "logger"
+TEST_LOG_DIR = File.expand_path(File.dirname(__FILE__) + "/../log")
+Hector.logger = Logger.new(File.open(TEST_LOG_DIR + "/test.log", "w+"))
+
require "hector/test_case"
require "hector/test_connection"
require "hector/integration_test"

0 comments on commit 4a5b5f3

Please sign in to comment.