write posts to disk

This commit is contained in:
Tom Preston-Werner
2008-10-19 21:56:53 -07:00
parent 84b00cc63e
commit 1c93bd0ce8
4 changed files with 32 additions and 1 deletions

View File

@@ -41,4 +41,14 @@ class TestPost < Test::Unit::TestCase
assert_equal "<<< \nh1. Foo Bar\n\nBest post ever >>>", p.content
end
def test_write
dest = File.join(File.dirname(__FILE__), *%w[dest])
FileUtils.rm_rf(dest)
p = Post.new(File.join(File.dirname(__FILE__), *%w[source posts]), "2008-10-18-foo-bar.textile")
layouts = {"default" => "<<< {{ content }} >>>"}
p.add_layout(layouts)
p.write(dest)
end
end

View File

@@ -21,4 +21,10 @@ class TestSite < Test::Unit::TestCase
assert_equal 1, @s.posts.size
end
def test_write_posts
@s.process
end
end