OSDN Git Service

[shogi-server] Enhance capability of Floodgate configuration file
[shogi-server/shogi-server.git] / test / TC_logger.rb
index 5c8689c..698a33d 100644 (file)
@@ -31,14 +31,6 @@ class TestLogger < Test::Unit::TestCase
     @logger.formatter = ShogiServer::Formatter.new
     @logger.level = TestableLogger::DEBUG
     @logger.datetime_format = "%Y-%m-%d %H:%M:%S"
-    @test_dir = File.join($topdir, "hoge", "hoo", "foo.txt")
-  end
-
-  def teardown
-    if FileTest.directory?(File.dirname(@test_dir))
-      Dir.rmdir(File.dirname(@test_dir))
-      Dir.rmdir(File.join($topdir, "hoge"))
-    end
   end
 
   def test_dummy
@@ -82,14 +74,9 @@ class TestLogger < Test::Unit::TestCase
     @logger.info("test_shift_log_period")
     now =  Time.mktime(2010, 7, 25, 23, 59, 59)
     @logger.logdev.shift_log_period(now)
-    assert_equal [["/home/daigo/rubyprojects/shogi-server/test/TC_logger_test.log",
-        "/home/daigo/rubyprojects/shogi-server/test/2010/07/24/TC_logger_test.log"]], 
+    assert_equal [[File.join($topdir, "TC_logger_test.log"),
+                   File.join($topdir, "2010", "07", "24", "TC_logger_test.log")]],
         @logger.logdev.result_rename_file
   end
 
-  def test_mkdir_for
-    assert !FileTest.directory?(File.dirname(@test_dir))
-    @logger.logdev.mkdir_for(@test_dir)
-    assert FileTest.directory?(File.dirname(@test_dir))
-  end
 end