Fixed that the tests weren't really working
git-svn-id: svn://hamptoncatlin.com/haml/trunk@38 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
b1836525a8
commit
c72a422799
|
@ -130,7 +130,7 @@ module Haml #:nodoc:
|
||||||
attributes = parse_class_and_id(attributes.to_s)
|
attributes = parse_class_and_id(attributes.to_s)
|
||||||
attributes.merge!(template_eval(attributes_hash)) unless (attributes_hash.nil? || attributes_hash.empty?)
|
attributes.merge!(template_eval(attributes_hash)) unless (attributes_hash.nil? || attributes_hash.empty?)
|
||||||
|
|
||||||
if action == '\/'
|
if action == '/'
|
||||||
atomic_tag(tag_name, attributes)
|
atomic_tag(tag_name, attributes)
|
||||||
elsif action == '=' || action == '~'
|
elsif action == '=' || action == '~'
|
||||||
value = template_eval(value)
|
value = template_eval(value)
|
||||||
|
|
|
@ -26,8 +26,9 @@ class HamlTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_renders_correctly(name)
|
def assert_renders_correctly(name)
|
||||||
load_result(name).scan(/\n/).zip(@base.render(name).scan(/\n/)).each do |pair|
|
load_result(name).split("\n").zip(@base.render(name).split("\n")).each do |pair|
|
||||||
assert_equal(pair.first, pair.last)
|
assert_equal(pair.first, pair.last)
|
||||||
|
#puts pair.inspect
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -48,6 +49,7 @@ class HamlTest < Test::Unit::TestCase
|
||||||
assert_renders_correctly("helpers")
|
assert_renders_correctly("helpers")
|
||||||
assert_renders_correctly("whitespace_handling")
|
assert_renders_correctly("whitespace_handling")
|
||||||
assert_renders_correctly("original_engine")
|
assert_renders_correctly("original_engine")
|
||||||
|
assert_renders_correctly("list")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_instance_variables
|
def test_instance_variables
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
&&&&&&&&&&&
|
&&&&&&&&&&&
|
||||||
Hello
nextline
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<ul>
|
||||||
|
<li>a</li>
|
||||||
|
<li>b</li>
|
||||||
|
<li>c</li>
|
||||||
|
<li>d</li>
|
||||||
|
<li>e</li>
|
||||||
|
<li>f</li>
|
||||||
|
<li>g</li>
|
||||||
|
<li>h</li>
|
||||||
|
<li>i</li>
|
||||||
|
</ul>
|
|
@ -7,12 +7,7 @@
|
||||||
<p>
|
<p>
|
||||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<p class='foo' style='color:green'>Cigarettes!</p>
|
||||||
<li>one</li>
|
|
||||||
<li>two</li>
|
|
||||||
<li>three</li>
|
|
||||||
</ul>
|
|
||||||
<p style='color:green' class='foo'>Cigarettes!</p>
|
|
||||||
<h2>Man alive!</h2>
|
<h2>Man alive!</h2>
|
||||||
<ul class='things'>
|
<ul class='things'>
|
||||||
<li>Slippers</li>
|
<li>Slippers</li>
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
= h("&&&&&&&&&&&") #this is an ActionView Helper... should load
|
= h("&&&&&&&&&&&") #this is an ActionView Helper... should load
|
||||||
= ("Hello\nnextline") #a haml helper
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
%ul
|
||||||
|
%li a
|
||||||
|
%li b
|
||||||
|
%li c
|
||||||
|
%li d
|
||||||
|
%li e
|
||||||
|
%li f
|
||||||
|
%li g
|
||||||
|
%li h
|
||||||
|
%li i
|
||||||
|
|
|
@ -5,22 +5,13 @@
|
||||||
#content
|
#content
|
||||||
%h1 This is a title!
|
%h1 This is a title!
|
||||||
%p Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
%p Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
||||||
|
|
||||||
%ul
|
|
||||||
%li one
|
|
||||||
%li two
|
|
||||||
%li three
|
|
||||||
|
|
||||||
%p{ :class => 'foo', :style => 'color:green' } Cigarettes!
|
%p{ :class => 'foo', :style => 'color:green' } Cigarettes!
|
||||||
|
%h2 Man alive!
|
||||||
%h2 Man alive
|
|
||||||
|
|
||||||
%ul.things
|
%ul.things
|
||||||
%li Slippers
|
%li Slippers
|
||||||
%li Shoes
|
%li Shoes
|
||||||
%li Bathrobe
|
%li Bathrobe
|
||||||
%li Coffee
|
%li Coffee
|
||||||
|
%pre
|
||||||
%pre
|
This is some text that's in a pre block!
|
||||||
This is some text that's in a pre block!
|
Let's see what happens when it's rendered! What about now, since we're on a new line?
|
||||||
Let's see what happens when it's rendered! What about now, since we're on a new line?
|
|
||||||
|
|
Loading…
Reference in New Issue