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
|
|
|
|
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"
|
|
|
|
assert File.exist?("log/mongrel_debug/rails.log"), "Didn't make the rails.log file"
|
|
|
|
assert File.size("log/mongrel_debug/rails.log") > 0, "Didn't write anything to the log."
|
2006-03-25 16:15:30 -05:00
|
|
|
|
|
|
|
Class.report_object_creations
|
|
|
|
Class.reset_object_creations
|
|
|
|
Class.report_object_creations
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|