haml 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of haml might be problematic. Click here for more details.

@@ -36,8 +36,16 @@ if defined?(RAILS_ROOT)
36
36
  # to not need updating.
37
37
  rails_init_file = File.join(RAILS_ROOT, 'vendor', 'plugins', 'haml', 'init.rb')
38
38
  haml_init_file = Haml.scope('init.rb')
39
- if File.exists?(rails_init_file)
40
- require 'fileutils'
41
- FileUtils.cp(haml_init_file, rails_init_file) unless FileUtils.cmp(rails_init_file, haml_init_file)
39
+ begin
40
+ if File.exists?(rails_init_file)
41
+ require 'fileutils'
42
+ FileUtils.cp(haml_init_file, rails_init_file) unless FileUtils.cmp(rails_init_file, haml_init_file)
43
+ end
44
+ rescue SystemCallError
45
+ warn <<END
46
+ HAML WARNING:
47
+ #{rails_init_file} is out of date and couldn't be automatically updated.
48
+ Please run `haml --rails #{File.expand_path(RAILS_ROOT)}' to update it.
49
+ END
42
50
  end
43
51
  end
@@ -35,7 +35,7 @@ module ActionView
35
35
  options[:filename] = file_name || 'compiled-template'
36
36
 
37
37
  begin
38
- Haml::Engine.new(template, options).def_method(CompiledTemplates, render_symbol, *locals)
38
+ Haml::Engine.new(template, options).def_method(CompiledTemplates, render_symbol, *locals_keys)
39
39
  rescue Exception => e
40
40
  if logger
41
41
  logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
@@ -253,6 +253,22 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
253
253
  # font-size: 30em;
254
254
  # font-weight: bold; }
255
255
  #
256
+ # === Rule Escaping
257
+ #
258
+ # In case, for whatever reason, you need to write a rule
259
+ # that begins with a Sass-meaningful character,
260
+ # you can escape it with a backslash (<tt>\</tt>).
261
+ # For example:
262
+ #
263
+ # #main
264
+ # \+div
265
+ # clear: both
266
+ #
267
+ # is compiled to:
268
+ #
269
+ # #main +div {
270
+ # clear: both; }
271
+ #
256
272
  # == Constants
257
273
  #
258
274
  # Sass has support for setting document-wide constants.
@@ -760,9 +776,16 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
760
776
  #
761
777
  # == Sass Options
762
778
  #
763
- # Options can be set by setting the hash <tt>Sass::Plugin.options</tt>
764
- # from <tt>environment.rb</tt> in Rails,
765
- # or by passing an options hash to Sass::Engine.
779
+ # Options can be set by setting the <tt>Sass::Plugin.options</tt> hash
780
+ # in <tt>environment.rb</tt> in Rails...
781
+ #
782
+ # Sass::Plugin.options[:style] = :compact
783
+ #
784
+ # ...or by setting the <tt>Merb::Config[:sass]</tt> hash in <tt>init.rb</tt> in Merb...
785
+ #
786
+ # Merb::Config[:sass][:style] = :compact
787
+ #
788
+ # ...or by passing an options hash to Sass::Engine.new.
766
789
  # Available options are:
767
790
  #
768
791
  # [<tt>:style</tt>] Sets the style of the CSS output.
@@ -119,17 +119,10 @@ module Sass
119
119
  next
120
120
  end
121
121
 
122
- # Is this a constant?
123
- if beginning_of_token && symbol == :const
124
- beginning_of_token = true
125
- to_return << :const
126
- next
127
- end
128
-
129
122
  # Are we looking at an operator?
130
123
  if symbol && (symbol != :mod || str.empty?)
131
124
  str = reset_str.call
132
- beginning_of_token = true
125
+ beginning_of_token = symbol != :close
133
126
  to_return << symbol
134
127
  next
135
128
  end
@@ -148,57 +141,30 @@ module Sass
148
141
  to_return
149
142
  end
150
143
 
151
- def parenthesize(value)
152
- parenthesize_helper(0, value, value.length)[0]
153
- end
154
-
155
- def parenthesize_helper(i, value, value_len, return_after_expr = false)
144
+ def parenthesize(value, return_after_expr = false)
156
145
  to_return = []
157
- beginning = i
158
- token = value[i]
159
-
160
- while i < value_len && token != :close
161
- if token == :open
162
- to_return.push(*value[beginning...i])
163
- sub, i = parenthesize_helper(i + 1, value, value_len)
164
- beginning = i
165
- to_return << sub
166
- elsif token == :neg
167
- if value[i + 1].nil?
168
- # This is never actually reached, but we'll leave it in just in case.
169
- raise Sass::SyntaxError.new("Unterminated unary minus.")
170
- elsif value[i + 1] == :open
171
- to_return.push(*value[beginning...i])
172
- sub, i = parenthesize_helper(i + 2, value, value_len)
173
- beginning = i
174
- to_return << [:neg, sub]
175
- elsif value[i + 1].is_a?(::Symbol)
176
- to_return.push(*value[beginning...i])
177
- sub, i = parenthesize_helper(i + 1, value, value_len, true)
178
- beginning = i
179
- to_return << [:neg, sub]
180
- else
181
- to_return.push(*value[beginning...i])
182
- to_return << [:neg, value[i + 1]]
183
- beginning = i = i + 2
184
- end
185
- return to_return[0], i if return_after_expr
186
- elsif token == :const
187
- raise Sass::SyntaxError.new("Unterminated constant.") if value[i + 1].nil?
188
- raise Sass::SyntaxError.new("Invalid constant.") unless value[i + 1].is_a?(::String)
189
-
190
- to_return.push(*value[beginning...i])
191
- to_return << [:const, value[i + 1]]
192
- beginning = i = i + 2
193
- return to_return[0], i if return_after_expr
146
+
147
+ while (token = value.shift) && token != :close
148
+ case token
149
+ when :open
150
+ to_return << parenthesize(value)
151
+ when :neg
152
+ # This is never actually reached, but we'll leave it in just in case.
153
+ raise Sass::SyntaxError.new("Unterminated unary minus.") if value.first.nil?
154
+ to_return << [:neg, parenthesize(value, true)]
155
+ when :const
156
+ raise Sass::SyntaxError.new("Unterminated constant.") if value.first.nil?
157
+ raise Sass::SyntaxError.new("Invalid constant.") unless value.first.is_a?(::String)
158
+
159
+ to_return << [:const, value.first]
160
+ value.shift
194
161
  else
195
- i += 1
162
+ to_return << token
196
163
  end
197
164
 
198
- token = value[i]
165
+ return to_return.first if return_after_expr
199
166
  end
200
- to_return.push(*value[beginning...i])
201
- return to_return, i + 1
167
+ return to_return
202
168
  end
203
169
 
204
170
  #--
@@ -207,7 +173,10 @@ module Sass
207
173
  #++
208
174
  def operationalize(value, constants)
209
175
  value = [value] unless value.is_a?(Array)
210
- if value.length == 1
176
+ case value.length
177
+ when 0
178
+ Sass::Constant::Nil.new
179
+ when 1
211
180
  value = value[0]
212
181
  if value.is_a? Array
213
182
  operationalize(value, constants)
@@ -216,7 +185,7 @@ module Sass
216
185
  else
217
186
  Literal.parse(value)
218
187
  end
219
- elsif value.length == 2
188
+ when 2
220
189
  if value[0] == :neg
221
190
  Operation.new(Sass::Constant::Number.new('0'), operationalize(value[1], constants), :minus)
222
191
  elsif value[0] == :const
@@ -224,7 +193,7 @@ module Sass
224
193
  else
225
194
  raise SyntaxError.new("Constant arithmetic error")
226
195
  end
227
- elsif value.length == 3
196
+ when 3
228
197
  Operation.new(operationalize(value[0], constants), operationalize(value[2], constants), value[1])
229
198
  else
230
199
  if SECOND_ORDER.include?(value[1]) && FIRST_ORDER.include?(value[3])
@@ -4,6 +4,7 @@ module Sass::Constant; class Literal; end; end; # :nodoc:
4
4
  require 'sass/constant/string'
5
5
  require 'sass/constant/number'
6
6
  require 'sass/constant/color'
7
+ require 'sass/constant/nil'
7
8
 
8
9
  class Sass::Constant::Literal # :nodoc:
9
10
  # The regular expression matching numbers.
@@ -0,0 +1,9 @@
1
+ require 'sass/constant/literal'
2
+
3
+ module Sass::Constant # :nodoc:
4
+ class Nil < Literal # :nodoc:
5
+ def to_s
6
+ ''
7
+ end
8
+ end
9
+ end
@@ -134,7 +134,7 @@ module Sass
134
134
  # and computes the tabulation of the line.
135
135
  def split_lines
136
136
  @line = 0
137
- old_tabs = 0
137
+ old_tabs = nil
138
138
  @template.each_with_index do |line, index|
139
139
  @line += 1
140
140
 
@@ -145,14 +145,16 @@ module Sass
145
145
  end
146
146
 
147
147
  if tabs # if line isn't blank
148
- if tabs - old_tabs > 1
148
+ raise SyntaxError.new("Indenting at the beginning of the document is illegal.", @line) if old_tabs.nil? && tabs > 0
149
+
150
+ if old_tabs && tabs - old_tabs > 1
149
151
  raise SyntaxError.new("#{tabs * 2} spaces were used for indentation. Sass must be indented using two spaces.", @line)
150
152
  end
151
153
  @lines << [line.strip, tabs]
152
154
 
153
155
  old_tabs = tabs
154
156
  else
155
- @lines << ['//', old_tabs]
157
+ @lines << ['//', old_tabs || 0]
156
158
  end
157
159
  end
158
160
 
@@ -287,7 +289,11 @@ END
287
289
  when MIXIN_DEFINITION_CHAR
288
290
  parse_mixin_definition(line)
289
291
  when MIXIN_INCLUDE_CHAR
290
- parse_mixin_include(line)
292
+ if line[1].nil? || line[1] == ?\s
293
+ Tree::RuleNode.new(line, @options[:style])
294
+ else
295
+ parse_mixin_include(line)
296
+ end
291
297
  else
292
298
  if line =~ ATTRIBUTE_ALTERNATE_MATCHER
293
299
  parse_attribute(line, ATTRIBUTE_ALTERNATE)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/test_helper'
2
+ require File.dirname(__FILE__) + '/../test_helper'
3
3
 
4
4
  class EngineTest < Test::Unit::TestCase
5
5
  # A map of erroneous Sass documents to the error messages they should produce.
@@ -32,11 +32,23 @@ END
32
32
  ".= a" => "Illegal element: classes and ids must have values.",
33
33
  "%p..a" => "Illegal element: classes and ids must have values.",
34
34
  "%a/ b" => "Self-closing tags can't have content.",
35
+ " %p foo" => "Indenting at the beginning of the document is illegal.",
36
+ " %p foo" => "Indenting at the beginning of the document is illegal.",
37
+ " \n\t\n %p foo" => ["Indenting at the beginning of the document is illegal.", 3],
35
38
 
36
39
  # Regression tests
37
40
  "- raise 'foo'\n\n\n\nbar" => ["foo", 1],
38
41
  "= 'foo'\n-raise 'foo'" => ["foo", 2],
39
42
  "\n\n\n- raise 'foo'" => ["foo", 4],
43
+ "foo\n\n\n bar" => ["Illegal nesting: nesting within plain text is illegal.", 4],
44
+ "%p/\n\n bar" => ["Illegal nesting: nesting within a self-closing tag is illegal.", 3],
45
+ "%p foo\n\n bar" => ["Illegal nesting: content can't be both given on the same line as %p and nested within it.", 3],
46
+ "/ foo\n\n bar" => ["Illegal nesting: nesting within a tag that already has content is illegal.", 3],
47
+ "!!!\n\n bar" => ["Illegal nesting: nesting within a header command is illegal.", 3],
48
+ "foo\n\n\n\tbar" => [<<END.strip, 4],
49
+ A tab character was used for indentation. Haml must be indented using two spaces.
50
+ Are you sure you have soft tabs enabled in your editor?
51
+ END
40
52
  }
41
53
 
42
54
  User = Struct.new('User', :id)
@@ -541,6 +553,13 @@ END
541
553
  render("%p= 's' * 75", :ugly => true))
542
554
  end
543
555
 
556
+ def test_auto_preserve_unless_ugly
557
+ assert_equal("<pre>foo&#x000A;bar</pre>\n", render('%pre="foo\nbar"'))
558
+ assert_equal("<pre>foo\nbar</pre>\n", render("%pre\n foo\n bar"))
559
+ assert_equal("<pre>foo\nbar</pre>\n", render('%pre="foo\nbar"', :ugly => true))
560
+ assert_equal("<pre>foo\nbar</pre>\n", render("%pre\n foo\n bar", :ugly => true))
561
+ end
562
+
544
563
  def test_xhtml_output_option
545
564
  assert_equal "<p>\n <br />\n</p>\n", render("%p\n %br", :format => :xhtml)
546
565
  assert_equal "<a />\n", render("%a/", :format => :xhtml)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/test_helper'
2
+ require File.dirname(__FILE__) + '/../test_helper'
3
3
  require 'haml/template'
4
4
 
5
5
  class HelperTest < Test::Unit::TestCase
@@ -105,7 +105,23 @@ class HelperTest < Test::Unit::TestCase
105
105
  end
106
106
 
107
107
  def test_haml_tag_non_autoclosed_tags_arent_closed
108
- assert_equal("<p>\n</p>\n", render("- haml_tag :p"))
108
+ assert_equal("<p></p>\n", render("- haml_tag :p"))
109
+ end
110
+
111
+ def test_haml_tag_renders_text_on_a_single_line
112
+ assert_equal("<p>#{'a' * 100}</p>\n", render("- haml_tag :p, 'a' * 100"))
113
+ end
114
+
115
+ def test_haml_tag_raises_error_for_multiple_content
116
+ assert_raise(Haml::Error) { render("- haml_tag :p, 'foo' do\n bar") }
117
+ end
118
+
119
+ def test_haml_tag_flags
120
+ assert_equal("<p />\n", render("- haml_tag :p, :/"))
121
+ assert_equal("<p>kumquat</p>\n", render("- haml_tag :p, :< do\n kumquat"))
122
+
123
+ assert_raise(Haml::Error) { render("- haml_tag :p, 'foo', :/") }
124
+ assert_raise(Haml::Error) { render("- haml_tag :p, :/ do\n foo") }
109
125
  end
110
126
 
111
127
  def test_is_haml
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- require 'test/unit'
4
- require File.dirname(__FILE__) + '/../../lib/haml'
2
+ require File.dirname(__FILE__) + '/../test_helper'
5
3
  require 'haml/html'
6
4
 
7
5
  class Html2HamlTest < Test::Unit::TestCase
@@ -79,9 +79,7 @@ foo
79
79
  <table>
80
80
  <tr>
81
81
  <td class='cell'>
82
- <strong>
83
- strong!
84
- </strong>
82
+ <strong>strong!</strong>
85
83
  data
86
84
  </td>
87
85
  <td>
@@ -90,5 +88,4 @@ foo
90
88
  </tr>
91
89
  </table>
92
90
  <hr />
93
- <div>
94
- </div>
91
+ <div></div>
@@ -17,7 +17,6 @@ Embedded? one af"t"er another!
17
17
  <p>Embedded? true!</p>
18
18
  <p>Embedded? twice! true!</p>
19
19
  <p>Embedded? one af"t"er another!</p>
20
- <div class='render'><em>wow!</em></div>
21
20
  stuff followed by whitespace
22
21
  <strong>block with whitespace</strong>
23
22
  <p>
@@ -32,3 +32,9 @@
32
32
  Bar
33
33
  </div></q>
34
34
  </p>
35
+ <p>
36
+ <q>foo</q>
37
+ <q a='2'>
38
+ bar
39
+ </q>
40
+ </p>
@@ -75,7 +75,7 @@
75
75
  </p>
76
76
  <pre> ___&#x000A; ,o88888&#x000A; ,o8888888'&#x000A; ,:o:o:oooo. ,8O88Pd8888"&#x000A; ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"&#x000A; ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"&#x000A; , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"&#x000A; , ..:.::o:ooOoOO8O888O8O,COCOO"&#x000A; , . ..:.::o:ooOoOOOO8OOOOCOCO"&#x000A; . ..:.::o:ooOoOoOO8O8OCCCC"o&#x000A; . ..:.::o:ooooOoCoCCC"o:o&#x000A; . ..:.::o:o:,cooooCo"oo:o:&#x000A; ` . . ..:.:cocoooo"'o:o:::'&#x000A; .` . ..::ccccoc"'o:o:o:::'&#x000A; :.:. ,c:cccc"':.:.:.:.:.'&#x000A; ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/&#x000A; ...:.'.:.::::"' . . . . .'&#x000A; .. . ....:."' ` . . . ''&#x000A; . . . ...."'&#x000A; .. . ."' -hrr-&#x000A; .&#x000A;&#x000A;&#x000A; It's a planet!&#x000A;%strong This shouldn't be bold!</pre>
77
77
  <strong>This should!</strong>
78
- <textarea> ___ ___ ___ ___ &#x000A; /\__\ /\ \ /\__\ /\__\&#x000A; /:/ / /::\ \ /::| | /:/ /&#x000A; /:/__/ /:/\:\ \ /:|:| | /:/ / &#x000A; /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ / &#x000A; /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/ &#x000A; \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \ &#x000A; \::/ / \::/ / /:/ / \:\ \ &#x000A; /:/ / /:/ / /:/ / \:\ \ &#x000A; /:/ / /:/ / /:/ / \:\__\&#x000A; \/__/ \/__/ \/__/ \/__/&#x000A;&#x000A; Many&#x000A; thanks&#x000A; to&#x000A; http://www.network-science.de/ascii/
78
+ <textarea> ___ ___ ___ ___ &#x000A; /\__\ /\ \ /\__\ /\__\&#x000A; /:/ / /::\ \ /::| | /:/ /&#x000A; /:/__/ /:/\:\ \ /:|:| | /:/ / &#x000A; /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ / &#x000A; /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/ &#x000A; \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \ &#x000A; \::/ / \::/ / /:/ / \:\ \ &#x000A; /:/ / /:/ / /:/ / \:\ \ &#x000A; /:/ / /:/ / /:/ / \:\__\&#x000A; \/__/ \/__/ \/__/ \/__/&#x000A; &#x000A; Many&#x000A; thanks&#x000A; to&#x000A; http://www.network-science.de/ascii/
79
79
  <strong>indeed!</strong></textarea>
80
80
  </div>
81
81
  <div class='foo'>
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/test_helper'
2
+ require File.dirname(__FILE__) + '/../test_helper'
3
3
  require 'haml/template'
4
4
  require File.dirname(__FILE__) + '/mocks/article'
5
5
 
6
-
7
6
  module Haml::Filters::Test
8
7
  include Haml::Filters::Base
9
8
 
@@ -12,14 +11,21 @@ module Haml::Filters::Test
12
11
  end
13
12
  end
14
13
 
14
+ module Haml::Helpers
15
+ def test_partial(name, locals = {})
16
+ Haml::Engine.new(File.read(File.join(TemplateTest::TEMPLATE_PATH, "_#{name}.haml"))).render(self, locals)
17
+ end
18
+ end
19
+
15
20
  class TemplateTest < Test::Unit::TestCase
16
- @@templates = %w{ very_basic standard helpers
21
+ TEMPLATE_PATH = File.join(File.dirname(__FILE__), "templates")
22
+ TEMPLATES = %w{ very_basic standard helpers
17
23
  whitespace_handling original_engine list helpful
18
24
  silent_script tag_parsing just_stuff partials
19
25
  filters nuke_outer_whitespace nuke_inner_whitespace }
20
26
 
21
27
  def setup
22
- @base = ActionView::Base.new(File.dirname(__FILE__) + "/templates/", {'article' => Article.new, 'foo' => 'value one'})
28
+ @base = ActionView::Base.new(TEMPLATE_PATH, 'article' => Article.new, 'foo' => 'value one')
23
29
  @base.send(:evaluate_assigns)
24
30
 
25
31
  # This is used by form_for.
@@ -39,20 +45,16 @@ class TemplateTest < Test::Unit::TestCase
39
45
 
40
46
  def assert_renders_correctly(name, &render_method)
41
47
  render_method ||= proc { |name| @base.render(name) }
42
- test = Proc.new do |rendered|
43
- load_result(name).split("\n").zip(rendered.split("\n")).each_with_index do |pair, line|
44
- message = "template: #{name}\nline: #{line}"
45
- assert_equal(pair.first, pair.last, message)
46
- end
48
+
49
+ load_result(name).split("\n").zip(render_method[name].split("\n")).each_with_index do |pair, line|
50
+ message = "template: #{name}\nline: #{line}"
51
+ assert_equal(pair.first, pair.last, message)
47
52
  end
48
- begin
49
- test.call(render_method[name])
50
- rescue ActionView::TemplateError => e
51
- if e.message =~ /Can't run [\w:]+ filter; required (one of|file) ((?:'\w+'(?: or )?)+)(, but none were found| not found)/
52
- puts "\nCouldn't require #{$2}; skipping a test."
53
- else
54
- raise e
55
- end
53
+ rescue ActionView::TemplateError => e
54
+ if e.message =~ /Can't run [\w:]+ filter; required (one of|file) ((?:'\w+'(?: or )?)+)(, but none were found| not found)/
55
+ puts "\nCouldn't require #{$2}; skipping a test."
56
+ else
57
+ raise e
56
58
  end
57
59
  end
58
60
 
@@ -60,30 +62,24 @@ class TemplateTest < Test::Unit::TestCase
60
62
  assert_equal('', render(''))
61
63
  end
62
64
 
63
- def test_templates_should_render_correctly
64
- @@templates.each do |template|
65
+ TEMPLATES.each do |template|
66
+ define_method "test_template_should_render_correctly [template: #{template}] " do
65
67
  assert_renders_correctly template
66
68
  end
67
69
  end
68
70
 
69
71
  def test_templates_should_render_correctly_with_render_proc
70
- @@templates.each do |template|
71
- assert_renders_correctly(template) do |name|
72
- engine = Haml::Engine.new(File.read(File.dirname(__FILE__) + "/templates/#{name}.haml"))
73
- engine.render_proc(@base).call
74
- end
72
+ assert_renders_correctly("standard") do |name|
73
+ engine = Haml::Engine.new(File.read(File.dirname(__FILE__) + "/templates/#{name}.haml"))
74
+ engine.render_proc(@base).call
75
75
  end
76
76
  end
77
-
77
+
78
78
  def test_templates_should_render_correctly_with_def_method
79
- @@templates.each do |template|
80
- assert_renders_correctly(template) do |name|
81
- method = "render_haml_" + name.gsub(/[^a-zA-Z0-9]/, '_')
82
-
83
- engine = Haml::Engine.new(File.read(File.dirname(__FILE__) + "/templates/#{name}.haml"))
84
- engine.def_method(@base, method)
85
- @base.send(method)
86
- end
79
+ assert_renders_correctly("standard") do |name|
80
+ engine = Haml::Engine.new(File.read(File.dirname(__FILE__) + "/templates/#{name}.haml"))
81
+ engine.def_method(@base, "render_standard")
82
+ @base.render_standard
87
83
  end
88
84
  end
89
85
 
@@ -115,19 +111,6 @@ class TemplateTest < Test::Unit::TestCase
115
111
  assert_equal("2\n", render("= 1+1"))
116
112
  end
117
113
 
118
- def test_rhtml_still_renders
119
- # Make sure it renders normally
120
- res = @base.render("../rhtml/standard")
121
- assert !(res.nil? || res.empty?)
122
-
123
- # Register Haml stuff in @base...
124
- @base.render("standard")
125
-
126
- # Does it still render?
127
- res = @base.render("../rhtml/standard")
128
- assert !(res.nil? || res.empty?)
129
- end
130
-
131
114
  def test_haml_options
132
115
  Haml::Template.options = { :suppress_eval => true }
133
116
  assert_equal({ :suppress_eval => true }, Haml::Template.options)