1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Make template_test work with old Rails versions.

This commit is contained in:
Nathan Weizenbaum 2008-12-06 20:26:31 -08:00
parent 15a84c38e6
commit 71c0146626

View file

@ -74,7 +74,11 @@ class TemplateTest < Test::Unit::TestCase
end
def assert_renders_correctly(name, &render_method)
render_method ||= proc { |name| @base.render(:file => name) }
if ActionPack::VERSION::MAJOR < 2 || ActionPack::VERSION::MINOR < 2
render_method ||= proc { |name| @base.render(name) }
else
render_method ||= proc { |name| @base.render(:file => name) }
end
load_result(name).split("\n").zip(render_method[name].split("\n")).each_with_index do |pair, line|
message = "template: #{name}\nline: #{line}"