test/haml/html2haml_test.rb in haml-2.0.5 vs test/haml/html2haml_test.rb in haml-2.0.6
- old
+ new
@@ -20,16 +20,14 @@
def test_multiple_class_names
assert_equal '.foo.bar.baz', render('<div class=" foo bar baz "> </div>')
end
def test_should_have_pretty_attributes
- assert_equal_attributes('%input{ :type => "text", :name => "login" }/',
- render('<input type="text" name="login" />'))
- assert_equal_attributes('%meta{ "http-equiv" => "Content-Type", :content => "text/html" }/',
- render('<meta http-equiv="Content-Type" content="text/html" />'))
- assert_equal_attributes('%div{ "xml:lang" => "hr" }/',
- render('<div xml:lang="hr" />'))
+ assert_equal_attributes('%input{ :type => "text", :name => "login" }',
+ render('<input type="text" name="login" />'))
+ assert_equal_attributes('%meta{ "http-equiv" => "Content-Type", :content => "text/html" }',
+ render('<meta http-equiv="Content-Type" content="text/html" />'))
end
def test_sqml_comment
assert_equal "/\n IE sucks", render('<!-- IE sucks -->')
end
@@ -76,19 +74,19 @@
render_rhtml(%Q{<%- form_for -%>})
end
protected
- def render(text, options = {})
- Haml::HTML.new(text, options).render.rstrip
- end
+ def render(text, options = {})
+ Haml::HTML.new(text, options).render.rstrip
+ end
- def render_rhtml(text)
- render(text, :rhtml => true)
- end
+ def render_rhtml(text)
+ render(text, :rhtml => true)
+ end
- def assert_equal_attributes(expected, result)
- expected_attr, result_attr = [expected, result].map { |s| s.gsub!(/\{ (.+) \}/, ''); $1.split(', ').sort }
- assert_equal expected_attr, result_attr
- assert_equal expected, result
- end
+ def assert_equal_attributes(expected, result)
+ expected_attr, result_attr = [expected, result].map { |s| s.gsub!(/\{ (.+) \}/, ''); $1.split(', ').sort }
+ assert_equal expected_attr, result_attr
+ assert_equal expected, result
+ end
end