public
Rubygem
Fork of nex3/haml
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/chriseppstein/haml.git
Same as previous in stable.


git-svn-id: svn://hamptoncatlin.com/haml/tags/stable@591 
7063305b-7217-0410-af8c-cdc13e5119b9
nex3 (author)
Thu Aug 16 14:51:46 -0700 2007
commit  03bd467a5151060a3e329aa28933a40e00c79bf5
tree    741bd8115a2aea1b9f00d465eea7eafc71a17f95
parent  d8e41ce7febc54b5fed1a66a6189087c1cb5624b
...
60
61
62
63
64
65
66
67
68
69
70
71
 
 
 
 
 
72
 
 
 
73
74
 
75
76
77
...
60
61
62
 
 
 
 
 
 
 
 
 
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
0
@@ -60,18 +60,18 @@ module Haml
0
       if flattened
0
         result = Haml::Helpers.find_and_preserve(result)
0
       end
0
- unless result.nil?
0
- result = result.to_s
0
- while result[-1] == 10 # \n
0
- # String#chomp is slow
0
- result = result[0...-1]
0
- end
0
-
0
- result = result.gsub("\n", "\n#{tabs(tabulation)}")
0
- push_text result, tabulation
0
+
0
+ result = result.to_s
0
+ while result[-1] == 10 # \n
0
+ # String#chomp is slow
0
+ result = result[0...-1]
0
       end
0
+
0
+ result = result.gsub("\n", "\n#{tabs(tabulation)}")
0
+ push_text result, tabulation
0
       nil
0
     end
0
+
0
     
0
     def open_prerendered_tag(tag, tabulation)
0
       @buffer << "#{tabs(tabulation)}#{tag}"
...
58
59
60
 
 
 
 
 
 
 
 
61
62
63
...
58
59
60
61
62
63
64
65
66
67
68
69
70
71
0
@@ -58,6 +58,14 @@ class EngineTest < Test::Unit::TestCase
0
     assert_equal("<p>\n Hello World\n</p>\n", render("%p\n == Hello \#{who}", :locals => {:who => 'World'}))
0
   end
0
 
0
+ def test_nil_tag_value_should_render_as_empty
0
+ assert_equal("<p></p>\n", render("%p= nil"))
0
+ end
0
+
0
+ def test_tag_with_failed_if_should_render_as_empty
0
+ assert_equal("<p></p>\n", render("%p= 'Hello' if false"))
0
+ end
0
+
0
   # Options tests
0
 
0
   def test_stop_eval

Comments

    No one has commented yet.