1 require File.dirname(__FILE__) + '/../helpers'
4 class TemplateTest < Test::Unit::TestCase
7 site = Bloggit::Site.from_file(File.join(File.dirname(__FILE__), '../fixtures/test.blog') )
13 should "render templates from text" do
14 output = Template.from_text('Hello, <%= name %>').render :template=>{:name=>'Sally'}
15 assert "Hello, Sally", output
18 should "render templates from file" do
19 output = Template.from_file( File.join( File.dirname(__FILE__), '..', 'fixtures', 'template.html.erb') ).render :template=>{:name=>'Bob'}
20 assert "Hello, Bob", output
23 should "generate URLs correctly"