From a0c0d983bf6df8e217956c63cb5c7de0b871ca61 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 16 Mar 2013 13:59:40 +0100 Subject: [PATCH] Using a test_dir helper method for tests. --- test/helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index f4bdcf19..51194f56 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -28,17 +28,21 @@ class Test::Unit::TestCase include RR::Adapters::TestUnit def dest_dir(*subdirs) - File.join(File.dirname(__FILE__), 'dest', *subdirs) + test_dir('dest', *subdirs) end def source_dir(*subdirs) - File.join(File.dirname(__FILE__), 'source', *subdirs) + test_dir('source', *subdirs) end def clear_dest FileUtils.rm_rf(dest_dir) end + def test_dir(*subdirs) + File.join(File.dirname(__FILE__), *subdirs) + end + def capture_stdout $old_stdout = $stdout $stdout = StringIO.new