test/helper.rb in jekyll-1.0.0.beta1 vs test/helper.rb in jekyll-1.0.0.beta2

- old
+ new

@@ -26,18 +26,28 @@ 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 directory_with_contents(path) + FileUtils.rm_rf(path) + FileUtils.mkdir(path) + File.open("#{path}/index.html", "w"){ |f| f.write("I was previously generated.") } end def capture_stdout $old_stdout = $stdout $stdout = StringIO.new