Skip to content

Commit

Permalink
Make template_test work with old Rails versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Dec 7, 2008
1 parent 15a84c3 commit 71c0146
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/haml/template_test.rb
Expand Up @@ -74,7 +74,11 @@ def load_result(name)
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}"
Expand Down

0 comments on commit 71c0146

Please sign in to comment.