2006-06-30 16:42:12 -04:00
|
|
|
# Copyright (c) 2005 Zed A. Shaw
|
|
|
|
# You can redistribute it and/or modify it under the same terms as Ruby.
|
|
|
|
#
|
|
|
|
# Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html
|
|
|
|
# for more information.
|
2006-05-21 10:46:42 -04:00
|
|
|
|
2006-03-26 15:01:50 -05:00
|
|
|
require 'fileutils'
|
|
|
|
FileUtils.mkdir_p "log/mongrel_debug"
|
|
|
|
|
2006-03-25 16:15:30 -05:00
|
|
|
require 'test/unit'
|
|
|
|
require 'mongrel/rails'
|
|
|
|
require 'mongrel/debug'
|
2006-03-26 15:01:50 -05:00
|
|
|
|
2006-03-25 16:15:30 -05:00
|
|
|
|
|
|
|
class MongrelDbgTest < Test::Unit::TestCase
|
|
|
|
|
|
|
|
def setup
|
2006-03-26 15:01:50 -05:00
|
|
|
FileUtils.rm_rf "log/mongrel_debug"
|
2006-03-25 16:15:30 -05:00
|
|
|
MongrelDbg::configure
|
|
|
|
end
|
|
|
|
|
2006-03-26 15:01:50 -05:00
|
|
|
|
2006-03-25 16:15:30 -05:00
|
|
|
def test_tracing_to_log
|
2006-04-01 04:09:10 -05:00
|
|
|
out = StringIO.new
|
|
|
|
|
2006-03-25 16:15:30 -05:00
|
|
|
MongrelDbg::begin_trace(:rails)
|
|
|
|
MongrelDbg::trace(:rails, "Good stuff")
|
|
|
|
MongrelDbg::end_trace(:rails)
|
|
|
|
|
2006-03-26 15:01:50 -05:00
|
|
|
assert File.exist?("log/mongrel_debug"), "Didn't make logging directory"
|
2006-03-25 16:15:30 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|