Using a test_dir helper method for tests.
This commit is contained in:
parent
1d920f52f1
commit
a0c0d983bf
|
@ -28,17 +28,21 @@ class Test::Unit::TestCase
|
||||||
include RR::Adapters::TestUnit
|
include RR::Adapters::TestUnit
|
||||||
|
|
||||||
def dest_dir(*subdirs)
|
def dest_dir(*subdirs)
|
||||||
File.join(File.dirname(__FILE__), 'dest', *subdirs)
|
test_dir('dest', *subdirs)
|
||||||
end
|
end
|
||||||
|
|
||||||
def source_dir(*subdirs)
|
def source_dir(*subdirs)
|
||||||
File.join(File.dirname(__FILE__), 'source', *subdirs)
|
test_dir('source', *subdirs)
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear_dest
|
def clear_dest
|
||||||
FileUtils.rm_rf(dest_dir)
|
FileUtils.rm_rf(dest_dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_dir(*subdirs)
|
||||||
|
File.join(File.dirname(__FILE__), *subdirs)
|
||||||
|
end
|
||||||
|
|
||||||
def capture_stdout
|
def capture_stdout
|
||||||
$old_stdout = $stdout
|
$old_stdout = $stdout
|
||||||
$stdout = StringIO.new
|
$stdout = StringIO.new
|
||||||
|
|
Loading…
Reference in New Issue