Skip to content

Commit

Permalink
fix tests for command line
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Dec 13, 2008
1 parent 31d7e80 commit 2a8345d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion test/suite.rb
@@ -1,6 +1,9 @@
require 'test/unit'

# for some reason these tests fail when run via TextMate
# but succeed when run on the command line.

tests = Dir["#{File.dirname(__FILE__)}/test_*.rb"]
tests.each do |file|
require file
end
end
6 changes: 3 additions & 3 deletions test/test_post.rb
Expand Up @@ -56,15 +56,15 @@ def test_transform
p.read_yaml(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-10-18-foo-bar.textile")
p.transform

assert_equal "<h1>{{ page.title }}</h1>\n\n\n\t<p>Best <strong>post</strong> ever</p>", p.content
assert_equal "<h1>{{ page.title }}</h1>\n<p>Best <strong>post</strong> ever</p>", p.content
end

def test_add_layout
p = Post.new(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-10-18-foo-bar.textile")
layouts = {"default" => Layout.new(File.join(File.dirname(__FILE__), *%w[source _layouts]), "simple.html")}
p.add_layout(layouts, {"site" => {"posts" => []}})

assert_equal "<<< <h1>Foo Bar</h1>\n\n\n\t<p>Best <strong>post</strong> ever</p> >>>", p.output
assert_equal "<<< <h1>Foo Bar</h1>\n<p>Best <strong>post</strong> ever</p> >>>", p.output
end

def test_write
Expand All @@ -81,6 +81,6 @@ def test_data
layouts = {"default" => Layout.new(File.join(File.dirname(__FILE__), *%w[source _layouts]), "simple.html")}
p.add_layout(layouts, {"site" => {"posts" => []}})

assert_equal "<<< <p>url: /2008/11/21/complex.html\ndate: Fri Nov 21 00:00:00 -0800 2008\nid: /2008/11/21/complex</p> >>>", p.output
assert_equal "<<< <p>url: /2008/11/21/complex.html<br />\ndate: Fri Nov 21 00:00:00 -0800 2008<br />\nid: /2008/11/21/complex</p> >>>", p.output
end
end

0 comments on commit 2a8345d

Please sign in to comment.