haml 3.2.0.alpha.10 → 3.2.0.alpha.13

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.

Files changed (389) hide show
  1. data/.yardopts +19 -7
  2. data/CHANGELOG.md +1224 -0
  3. data/FAQ.md +157 -0
  4. data/README.md +99 -62
  5. data/REFERENCE.md +1404 -0
  6. data/Rakefile +52 -341
  7. data/init.rb +1 -18
  8. data/lib/haml.rb +6 -30
  9. data/lib/haml/buffer.rb +37 -16
  10. data/lib/haml/compiler.rb +52 -13
  11. data/lib/haml/engine.rb +61 -44
  12. data/lib/haml/exec.rb +21 -4
  13. data/lib/haml/filters.rb +136 -166
  14. data/lib/haml/helpers.rb +37 -10
  15. data/lib/haml/helpers/action_view_extensions.rb +2 -1
  16. data/lib/haml/helpers/action_view_mods.rb +67 -181
  17. data/lib/haml/helpers/rails_323_textarea_fix.rb +39 -0
  18. data/lib/haml/helpers/xss_mods.rb +9 -11
  19. data/lib/haml/html.rb +22 -9
  20. data/lib/haml/html/erb.rb +1 -1
  21. data/lib/haml/parser.rb +22 -15
  22. data/lib/haml/railtie.rb +2 -13
  23. data/lib/haml/template.rb +18 -85
  24. data/lib/haml/template/options.rb +1 -1
  25. data/lib/haml/template/plugin.rb +15 -101
  26. data/lib/haml/util.rb +120 -603
  27. data/lib/haml/version.rb +1 -107
  28. data/test/{haml/engine_test.rb → engine_test.rb} +137 -143
  29. data/test/{haml/erb → erb}/_av_partial_1.erb +1 -1
  30. data/test/{haml/erb → erb}/_av_partial_2.erb +1 -1
  31. data/test/{haml/erb → erb}/action_view.erb +1 -1
  32. data/test/{haml/erb → erb}/standard.erb +0 -0
  33. data/test/filters_test.rb +141 -0
  34. data/test/gemfiles/Gemfile.rails-3.0.x +4 -6
  35. data/test/gemfiles/Gemfile.rails-3.1.x +5 -6
  36. data/test/gemfiles/Gemfile.rails-3.2.x +6 -0
  37. data/test/haml-spec/LICENSE +14 -0
  38. data/test/{haml/spec → haml-spec}/README.md +26 -17
  39. data/test/haml-spec/lua_haml_spec.lua +38 -0
  40. data/test/haml-spec/perl_haml_test.pl +81 -0
  41. data/test/haml-spec/ruby_haml_test.rb +23 -0
  42. data/test/{haml/spec → haml-spec}/tests.json +132 -54
  43. data/test/{haml/helper_test.rb → helper_test.rb} +50 -36
  44. data/test/{haml/html2haml → html2haml}/erb_tests.rb +0 -0
  45. data/test/{haml/html2haml_test.rb → html2haml_test.rb} +11 -5
  46. data/test/{haml/markaby → markaby}/standard.mab +0 -0
  47. data/test/{haml/mocks → mocks}/article.rb +0 -0
  48. data/test/{haml/results → results}/content_for_layout.xhtml +0 -0
  49. data/test/{haml/results → results}/eval_suppressed.xhtml +0 -0
  50. data/test/{haml/results → results}/helpers.xhtml +0 -0
  51. data/test/{haml/results → results}/helpful.xhtml +0 -0
  52. data/test/{haml/results → results}/just_stuff.xhtml +0 -0
  53. data/test/{haml/results → results}/list.xhtml +0 -0
  54. data/test/{haml/results → results}/nuke_inner_whitespace.xhtml +0 -0
  55. data/test/{haml/results → results}/nuke_outer_whitespace.xhtml +0 -0
  56. data/test/{haml/results → results}/original_engine.xhtml +0 -0
  57. data/test/{haml/results → results}/partial_layout.xhtml +0 -0
  58. data/test/{haml/results → results}/partials.xhtml +0 -0
  59. data/test/{haml/results → results}/render_layout.xhtml +0 -0
  60. data/test/{haml/results → results}/silent_script.xhtml +1 -1
  61. data/test/{haml/results → results}/standard.xhtml +0 -0
  62. data/test/{haml/results → results}/tag_parsing.xhtml +0 -0
  63. data/test/{haml/results → results}/very_basic.xhtml +0 -0
  64. data/test/{haml/results → results}/whitespace_handling.xhtml +46 -50
  65. data/test/{haml/template_test.rb → template_test.rb} +20 -81
  66. data/test/{haml/templates → templates}/_av_partial_1.haml +1 -1
  67. data/test/{haml/templates → templates}/_av_partial_1_ugly.haml +1 -1
  68. data/test/{haml/templates → templates}/_av_partial_2.haml +1 -1
  69. data/test/{haml/templates → templates}/_av_partial_2_ugly.haml +1 -1
  70. data/test/{haml/templates → templates}/_layout.erb +0 -0
  71. data/test/{haml/templates → templates}/_layout_for_partial.haml +0 -0
  72. data/test/{haml/templates → templates}/_partial.haml +0 -0
  73. data/test/{haml/templates → templates}/_text_area.haml +0 -0
  74. data/test/{haml/templates → templates}/action_view.haml +1 -1
  75. data/test/{haml/templates → templates}/action_view_ugly.haml +1 -1
  76. data/test/{haml/templates → templates}/breakage.haml +0 -0
  77. data/test/{haml/templates → templates}/content_for_layout.haml +0 -0
  78. data/test/{haml/templates → templates}/eval_suppressed.haml +0 -0
  79. data/test/{haml/templates → templates}/helpers.haml +0 -0
  80. data/test/{haml/templates → templates}/helpful.haml +0 -0
  81. data/test/{haml/templates → templates}/just_stuff.haml +0 -0
  82. data/test/{haml/templates → templates}/list.haml +0 -0
  83. data/test/{haml/templates → templates}/nuke_inner_whitespace.haml +0 -0
  84. data/test/{haml/templates → templates}/nuke_outer_whitespace.haml +0 -0
  85. data/test/{haml/templates → templates}/original_engine.haml +0 -0
  86. data/test/templates/partial_layout.haml +3 -0
  87. data/test/{haml/templates → templates}/partialize.haml +0 -0
  88. data/test/{haml/templates → templates}/partials.haml +0 -0
  89. data/test/{haml/templates → templates}/render_layout.haml +0 -0
  90. data/test/{haml/templates → templates}/silent_script.haml +2 -2
  91. data/test/{haml/templates → templates}/standard.haml +0 -0
  92. data/test/{haml/templates → templates}/standard_ugly.haml +0 -0
  93. data/test/{haml/templates → templates}/tag_parsing.haml +0 -0
  94. data/test/{haml/templates → templates}/very_basic.haml +0 -0
  95. data/test/{haml/templates → templates}/whitespace_handling.haml +0 -0
  96. data/test/test_helper.rb +42 -34
  97. data/test/util_test.rb +80 -0
  98. metadata +259 -427
  99. data/CONTRIBUTING +0 -3
  100. data/REVISION +0 -1
  101. data/VERSION +0 -1
  102. data/VERSION_NAME +0 -1
  103. data/extra/update_watch.rb +0 -13
  104. data/lib/haml/root.rb +0 -7
  105. data/lib/haml/shared.rb +0 -78
  106. data/lib/haml/template/patch.rb +0 -58
  107. data/lib/sass.rb +0 -8
  108. data/lib/sass/plugin.rb +0 -10
  109. data/lib/sass/rails2_shim.rb +0 -9
  110. data/lib/sass/rails3_shim.rb +0 -16
  111. data/test/benchmark.rb +0 -91
  112. data/test/gemfiles/Gemfile.rails-2.0.x +0 -8
  113. data/test/gemfiles/Gemfile.rails-2.0.x.lock +0 -38
  114. data/test/gemfiles/Gemfile.rails-2.1.x +0 -8
  115. data/test/gemfiles/Gemfile.rails-2.1.x.lock +0 -38
  116. data/test/gemfiles/Gemfile.rails-2.2.x +0 -8
  117. data/test/gemfiles/Gemfile.rails-2.2.x.lock +0 -38
  118. data/test/gemfiles/Gemfile.rails-2.3.x +0 -8
  119. data/test/gemfiles/Gemfile.rails-2.3.x.lock +0 -40
  120. data/test/gemfiles/Gemfile.rails-3.0.x.lock +0 -85
  121. data/test/gemfiles/Gemfile.rails-3.1.x.lock +0 -98
  122. data/test/gemfiles/Gemfile.rails-xss-2.3.x +0 -9
  123. data/test/gemfiles/Gemfile.rails-xss-2.3.x.lock +0 -42
  124. data/test/haml/results/filters.xhtml +0 -62
  125. data/test/haml/spec/lua_haml_spec.lua +0 -30
  126. data/test/haml/spec/ruby_haml_test.rb +0 -19
  127. data/test/haml/spec_test.rb +0 -44
  128. data/test/haml/templates/filters.haml +0 -66
  129. data/test/haml/templates/partial_layout.haml +0 -10
  130. data/test/haml/util_test.rb +0 -300
  131. data/test/linked_rails.rb +0 -42
  132. data/vendor/sass/CONTRIBUTING +0 -3
  133. data/vendor/sass/MIT-LICENSE +0 -20
  134. data/vendor/sass/README.md +0 -201
  135. data/vendor/sass/Rakefile +0 -339
  136. data/vendor/sass/TODO +0 -39
  137. data/vendor/sass/VERSION +0 -1
  138. data/vendor/sass/VERSION_NAME +0 -1
  139. data/vendor/sass/bin/sass +0 -8
  140. data/vendor/sass/bin/sass-convert +0 -7
  141. data/vendor/sass/bin/scss +0 -8
  142. data/vendor/sass/doc-src/FAQ.md +0 -35
  143. data/vendor/sass/doc-src/INDENTED_SYNTAX.md +0 -210
  144. data/vendor/sass/doc-src/SASS_CHANGELOG.md +0 -2327
  145. data/vendor/sass/doc-src/SASS_REFERENCE.md +0 -1965
  146. data/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md +0 -155
  147. data/vendor/sass/ext/extconf.rb +0 -10
  148. data/vendor/sass/extra/update_watch.rb +0 -13
  149. data/vendor/sass/init.rb +0 -18
  150. data/vendor/sass/lib/sass.rb +0 -73
  151. data/vendor/sass/lib/sass/cache_stores.rb +0 -15
  152. data/vendor/sass/lib/sass/cache_stores/base.rb +0 -86
  153. data/vendor/sass/lib/sass/cache_stores/chain.rb +0 -33
  154. data/vendor/sass/lib/sass/cache_stores/filesystem.rb +0 -60
  155. data/vendor/sass/lib/sass/cache_stores/memory.rb +0 -47
  156. data/vendor/sass/lib/sass/cache_stores/null.rb +0 -25
  157. data/vendor/sass/lib/sass/callbacks.rb +0 -66
  158. data/vendor/sass/lib/sass/css.rb +0 -295
  159. data/vendor/sass/lib/sass/engine.rb +0 -878
  160. data/vendor/sass/lib/sass/environment.rb +0 -166
  161. data/vendor/sass/lib/sass/error.rb +0 -201
  162. data/vendor/sass/lib/sass/exec.rb +0 -672
  163. data/vendor/sass/lib/sass/importers.rb +0 -22
  164. data/vendor/sass/lib/sass/importers/base.rb +0 -139
  165. data/vendor/sass/lib/sass/importers/filesystem.rb +0 -149
  166. data/vendor/sass/lib/sass/less.rb +0 -382
  167. data/vendor/sass/lib/sass/logger.rb +0 -15
  168. data/vendor/sass/lib/sass/logger/base.rb +0 -32
  169. data/vendor/sass/lib/sass/logger/log_level.rb +0 -49
  170. data/vendor/sass/lib/sass/plugin.rb +0 -132
  171. data/vendor/sass/lib/sass/plugin/compiler.rb +0 -383
  172. data/vendor/sass/lib/sass/plugin/configuration.rb +0 -123
  173. data/vendor/sass/lib/sass/plugin/generic.rb +0 -15
  174. data/vendor/sass/lib/sass/plugin/merb.rb +0 -48
  175. data/vendor/sass/lib/sass/plugin/rack.rb +0 -60
  176. data/vendor/sass/lib/sass/plugin/rails.rb +0 -47
  177. data/vendor/sass/lib/sass/plugin/staleness_checker.rb +0 -173
  178. data/vendor/sass/lib/sass/railtie.rb +0 -9
  179. data/vendor/sass/lib/sass/repl.rb +0 -58
  180. data/vendor/sass/lib/sass/root.rb +0 -7
  181. data/vendor/sass/lib/sass/script.rb +0 -40
  182. data/vendor/sass/lib/sass/script/bool.rb +0 -18
  183. data/vendor/sass/lib/sass/script/color.rb +0 -480
  184. data/vendor/sass/lib/sass/script/css_lexer.rb +0 -29
  185. data/vendor/sass/lib/sass/script/css_parser.rb +0 -31
  186. data/vendor/sass/lib/sass/script/funcall.rb +0 -175
  187. data/vendor/sass/lib/sass/script/functions.rb +0 -1386
  188. data/vendor/sass/lib/sass/script/interpolation.rb +0 -79
  189. data/vendor/sass/lib/sass/script/lexer.rb +0 -339
  190. data/vendor/sass/lib/sass/script/list.rb +0 -83
  191. data/vendor/sass/lib/sass/script/literal.rb +0 -250
  192. data/vendor/sass/lib/sass/script/node.rb +0 -99
  193. data/vendor/sass/lib/sass/script/number.rb +0 -452
  194. data/vendor/sass/lib/sass/script/operation.rb +0 -99
  195. data/vendor/sass/lib/sass/script/parser.rb +0 -474
  196. data/vendor/sass/lib/sass/script/string.rb +0 -51
  197. data/vendor/sass/lib/sass/script/string_interpolation.rb +0 -103
  198. data/vendor/sass/lib/sass/script/unary_operation.rb +0 -64
  199. data/vendor/sass/lib/sass/script/variable.rb +0 -59
  200. data/vendor/sass/lib/sass/scss.rb +0 -17
  201. data/vendor/sass/lib/sass/scss/css_parser.rb +0 -46
  202. data/vendor/sass/lib/sass/scss/parser.rb +0 -960
  203. data/vendor/sass/lib/sass/scss/rx.rb +0 -128
  204. data/vendor/sass/lib/sass/scss/sass_parser.rb +0 -11
  205. data/vendor/sass/lib/sass/scss/script_lexer.rb +0 -15
  206. data/vendor/sass/lib/sass/scss/script_parser.rb +0 -25
  207. data/vendor/sass/lib/sass/scss/static_parser.rb +0 -40
  208. data/vendor/sass/lib/sass/selector.rb +0 -361
  209. data/vendor/sass/lib/sass/selector/abstract_sequence.rb +0 -62
  210. data/vendor/sass/lib/sass/selector/comma_sequence.rb +0 -81
  211. data/vendor/sass/lib/sass/selector/sequence.rb +0 -233
  212. data/vendor/sass/lib/sass/selector/simple.rb +0 -113
  213. data/vendor/sass/lib/sass/selector/simple_sequence.rb +0 -134
  214. data/vendor/sass/lib/sass/shared.rb +0 -78
  215. data/vendor/sass/lib/sass/tree/charset_node.rb +0 -22
  216. data/vendor/sass/lib/sass/tree/comment_node.rb +0 -90
  217. data/vendor/sass/lib/sass/tree/debug_node.rb +0 -18
  218. data/vendor/sass/lib/sass/tree/directive_node.rb +0 -23
  219. data/vendor/sass/lib/sass/tree/each_node.rb +0 -24
  220. data/vendor/sass/lib/sass/tree/extend_node.rb +0 -29
  221. data/vendor/sass/lib/sass/tree/for_node.rb +0 -36
  222. data/vendor/sass/lib/sass/tree/function_node.rb +0 -27
  223. data/vendor/sass/lib/sass/tree/if_node.rb +0 -52
  224. data/vendor/sass/lib/sass/tree/import_node.rb +0 -68
  225. data/vendor/sass/lib/sass/tree/media_node.rb +0 -32
  226. data/vendor/sass/lib/sass/tree/mixin_def_node.rb +0 -27
  227. data/vendor/sass/lib/sass/tree/mixin_node.rb +0 -32
  228. data/vendor/sass/lib/sass/tree/node.rb +0 -201
  229. data/vendor/sass/lib/sass/tree/prop_node.rb +0 -148
  230. data/vendor/sass/lib/sass/tree/return_node.rb +0 -18
  231. data/vendor/sass/lib/sass/tree/root_node.rb +0 -28
  232. data/vendor/sass/lib/sass/tree/rule_node.rb +0 -136
  233. data/vendor/sass/lib/sass/tree/variable_node.rb +0 -30
  234. data/vendor/sass/lib/sass/tree/visitors/base.rb +0 -75
  235. data/vendor/sass/lib/sass/tree/visitors/check_nesting.rb +0 -133
  236. data/vendor/sass/lib/sass/tree/visitors/convert.rb +0 -260
  237. data/vendor/sass/lib/sass/tree/visitors/cssize.rb +0 -175
  238. data/vendor/sass/lib/sass/tree/visitors/deep_copy.rb +0 -87
  239. data/vendor/sass/lib/sass/tree/visitors/perform.rb +0 -332
  240. data/vendor/sass/lib/sass/tree/visitors/set_options.rb +0 -97
  241. data/vendor/sass/lib/sass/tree/visitors/to_css.rb +0 -210
  242. data/vendor/sass/lib/sass/tree/warn_node.rb +0 -18
  243. data/vendor/sass/lib/sass/tree/while_node.rb +0 -18
  244. data/vendor/sass/lib/sass/util.rb +0 -721
  245. data/vendor/sass/lib/sass/util/subset_map.rb +0 -101
  246. data/vendor/sass/lib/sass/version.rb +0 -112
  247. data/vendor/sass/rails/init.rb +0 -1
  248. data/vendor/sass/sass.gemspec +0 -33
  249. data/vendor/sass/test/Gemfile +0 -4
  250. data/vendor/sass/test/Gemfile.lock +0 -19
  251. data/vendor/sass/test/sass/cache_test.rb +0 -89
  252. data/vendor/sass/test/sass/callbacks_test.rb +0 -61
  253. data/vendor/sass/test/sass/conversion_test.rb +0 -1199
  254. data/vendor/sass/test/sass/css2sass_test.rb +0 -373
  255. data/vendor/sass/test/sass/data/hsl-rgb.txt +0 -319
  256. data/vendor/sass/test/sass/engine_test.rb +0 -2567
  257. data/vendor/sass/test/sass/extend_test.rb +0 -1348
  258. data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
  259. data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
  260. data/vendor/sass/test/sass/functions_test.rb +0 -1038
  261. data/vendor/sass/test/sass/importer_test.rb +0 -192
  262. data/vendor/sass/test/sass/less_conversion_test.rb +0 -653
  263. data/vendor/sass/test/sass/logger_test.rb +0 -58
  264. data/vendor/sass/test/sass/mock_importer.rb +0 -49
  265. data/vendor/sass/test/sass/more_results/more1.css +0 -9
  266. data/vendor/sass/test/sass/more_results/more1_with_line_comments.css +0 -26
  267. data/vendor/sass/test/sass/more_results/more_import.css +0 -29
  268. data/vendor/sass/test/sass/more_templates/_more_partial.sass +0 -2
  269. data/vendor/sass/test/sass/more_templates/more1.sass +0 -23
  270. data/vendor/sass/test/sass/more_templates/more_import.sass +0 -11
  271. data/vendor/sass/test/sass/plugin_test.rb +0 -472
  272. data/vendor/sass/test/sass/results/alt.css +0 -4
  273. data/vendor/sass/test/sass/results/basic.css +0 -9
  274. data/vendor/sass/test/sass/results/compact.css +0 -5
  275. data/vendor/sass/test/sass/results/complex.css +0 -86
  276. data/vendor/sass/test/sass/results/compressed.css +0 -1
  277. data/vendor/sass/test/sass/results/expanded.css +0 -19
  278. data/vendor/sass/test/sass/results/if.css +0 -3
  279. data/vendor/sass/test/sass/results/import.css +0 -31
  280. data/vendor/sass/test/sass/results/import_charset.css +0 -4
  281. data/vendor/sass/test/sass/results/import_charset_1_8.css +0 -4
  282. data/vendor/sass/test/sass/results/import_charset_ibm866.css +0 -4
  283. data/vendor/sass/test/sass/results/line_numbers.css +0 -49
  284. data/vendor/sass/test/sass/results/mixins.css +0 -95
  285. data/vendor/sass/test/sass/results/multiline.css +0 -24
  286. data/vendor/sass/test/sass/results/nested.css +0 -22
  287. data/vendor/sass/test/sass/results/options.css +0 -1
  288. data/vendor/sass/test/sass/results/parent_ref.css +0 -13
  289. data/vendor/sass/test/sass/results/script.css +0 -16
  290. data/vendor/sass/test/sass/results/scss_import.css +0 -31
  291. data/vendor/sass/test/sass/results/scss_importee.css +0 -2
  292. data/vendor/sass/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
  293. data/vendor/sass/test/sass/results/subdir/subdir.css +0 -3
  294. data/vendor/sass/test/sass/results/units.css +0 -11
  295. data/vendor/sass/test/sass/results/warn.css +0 -0
  296. data/vendor/sass/test/sass/results/warn_imported.css +0 -0
  297. data/vendor/sass/test/sass/script_conversion_test.rb +0 -285
  298. data/vendor/sass/test/sass/script_test.rb +0 -514
  299. data/vendor/sass/test/sass/scss/css_test.rb +0 -922
  300. data/vendor/sass/test/sass/scss/rx_test.rb +0 -156
  301. data/vendor/sass/test/sass/scss/scss_test.rb +0 -1273
  302. data/vendor/sass/test/sass/scss/test_helper.rb +0 -37
  303. data/vendor/sass/test/sass/templates/_imported_charset_ibm866.sass +0 -4
  304. data/vendor/sass/test/sass/templates/_imported_charset_utf8.sass +0 -4
  305. data/vendor/sass/test/sass/templates/_partial.sass +0 -2
  306. data/vendor/sass/test/sass/templates/alt.sass +0 -16
  307. data/vendor/sass/test/sass/templates/basic.sass +0 -23
  308. data/vendor/sass/test/sass/templates/bork1.sass +0 -2
  309. data/vendor/sass/test/sass/templates/bork2.sass +0 -2
  310. data/vendor/sass/test/sass/templates/bork3.sass +0 -2
  311. data/vendor/sass/test/sass/templates/bork4.sass +0 -2
  312. data/vendor/sass/test/sass/templates/bork5.sass +0 -3
  313. data/vendor/sass/test/sass/templates/compact.sass +0 -17
  314. data/vendor/sass/test/sass/templates/complex.sass +0 -305
  315. data/vendor/sass/test/sass/templates/compressed.sass +0 -15
  316. data/vendor/sass/test/sass/templates/expanded.sass +0 -17
  317. data/vendor/sass/test/sass/templates/if.sass +0 -11
  318. data/vendor/sass/test/sass/templates/import.sass +0 -12
  319. data/vendor/sass/test/sass/templates/import_charset.sass +0 -7
  320. data/vendor/sass/test/sass/templates/import_charset_1_8.sass +0 -4
  321. data/vendor/sass/test/sass/templates/import_charset_ibm866.sass +0 -9
  322. data/vendor/sass/test/sass/templates/importee.less +0 -2
  323. data/vendor/sass/test/sass/templates/importee.sass +0 -19
  324. data/vendor/sass/test/sass/templates/line_numbers.sass +0 -13
  325. data/vendor/sass/test/sass/templates/mixin_bork.sass +0 -5
  326. data/vendor/sass/test/sass/templates/mixins.sass +0 -76
  327. data/vendor/sass/test/sass/templates/multiline.sass +0 -20
  328. data/vendor/sass/test/sass/templates/nested.sass +0 -25
  329. data/vendor/sass/test/sass/templates/nested_bork1.sass +0 -2
  330. data/vendor/sass/test/sass/templates/nested_bork2.sass +0 -2
  331. data/vendor/sass/test/sass/templates/nested_bork3.sass +0 -2
  332. data/vendor/sass/test/sass/templates/nested_bork4.sass +0 -2
  333. data/vendor/sass/test/sass/templates/nested_bork5.sass +0 -2
  334. data/vendor/sass/test/sass/templates/nested_import.sass +0 -2
  335. data/vendor/sass/test/sass/templates/nested_mixin_bork.sass +0 -6
  336. data/vendor/sass/test/sass/templates/options.sass +0 -2
  337. data/vendor/sass/test/sass/templates/parent_ref.sass +0 -25
  338. data/vendor/sass/test/sass/templates/script.sass +0 -101
  339. data/vendor/sass/test/sass/templates/scss_import.scss +0 -11
  340. data/vendor/sass/test/sass/templates/scss_importee.scss +0 -1
  341. data/vendor/sass/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
  342. data/vendor/sass/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
  343. data/vendor/sass/test/sass/templates/subdir/subdir.sass +0 -6
  344. data/vendor/sass/test/sass/templates/units.sass +0 -11
  345. data/vendor/sass/test/sass/templates/warn.sass +0 -3
  346. data/vendor/sass/test/sass/templates/warn_imported.sass +0 -4
  347. data/vendor/sass/test/sass/test_helper.rb +0 -8
  348. data/vendor/sass/test/sass/util/subset_map_test.rb +0 -91
  349. data/vendor/sass/test/sass/util_test.rb +0 -266
  350. data/vendor/sass/test/test_helper.rb +0 -69
  351. data/vendor/sass/vendor/fssm/Gemfile +0 -3
  352. data/vendor/sass/vendor/fssm/LICENSE +0 -20
  353. data/vendor/sass/vendor/fssm/README.markdown +0 -83
  354. data/vendor/sass/vendor/fssm/Rakefile +0 -11
  355. data/vendor/sass/vendor/fssm/example.rb +0 -12
  356. data/vendor/sass/vendor/fssm/fssm.gemspec +0 -24
  357. data/vendor/sass/vendor/fssm/lib/fssm.rb +0 -37
  358. data/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
  359. data/vendor/sass/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
  360. data/vendor/sass/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
  361. data/vendor/sass/vendor/fssm/lib/fssm/backends/rbfsevent.rb +0 -42
  362. data/vendor/sass/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
  363. data/vendor/sass/vendor/fssm/lib/fssm/monitor.rb +0 -36
  364. data/vendor/sass/vendor/fssm/lib/fssm/path.rb +0 -94
  365. data/vendor/sass/vendor/fssm/lib/fssm/pathname.rb +0 -36
  366. data/vendor/sass/vendor/fssm/lib/fssm/state/directory.rb +0 -75
  367. data/vendor/sass/vendor/fssm/lib/fssm/state/file.rb +0 -24
  368. data/vendor/sass/vendor/fssm/lib/fssm/support.rb +0 -92
  369. data/vendor/sass/vendor/fssm/lib/fssm/tree.rb +0 -176
  370. data/vendor/sass/vendor/fssm/lib/fssm/version.rb +0 -3
  371. data/vendor/sass/vendor/fssm/profile/prof-cache.rb +0 -40
  372. data/vendor/sass/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
  373. data/vendor/sass/vendor/fssm/profile/prof-pathname-rubinius.rb +0 -35
  374. data/vendor/sass/vendor/fssm/profile/prof-pathname.rb +0 -68
  375. data/vendor/sass/vendor/fssm/profile/prof-plain-pathname.html +0 -988
  376. data/vendor/sass/vendor/fssm/profile/prof.html +0 -2379
  377. data/vendor/sass/vendor/fssm/spec/count_down_latch.rb +0 -151
  378. data/vendor/sass/vendor/fssm/spec/monitor_spec.rb +0 -202
  379. data/vendor/sass/vendor/fssm/spec/path_spec.rb +0 -96
  380. data/vendor/sass/vendor/fssm/spec/root/duck/quack.txt +0 -0
  381. data/vendor/sass/vendor/fssm/spec/root/file.css +0 -0
  382. data/vendor/sass/vendor/fssm/spec/root/file.rb +0 -0
  383. data/vendor/sass/vendor/fssm/spec/root/file.yml +0 -0
  384. data/vendor/sass/vendor/fssm/spec/root/moo/cow.txt +0 -0
  385. data/vendor/sass/vendor/fssm/spec/spec_helper.rb +0 -14
  386. data/vendor/sass/yard/callbacks.rb +0 -29
  387. data/vendor/sass/yard/default/fulldoc/html/css/common.sass +0 -26
  388. data/vendor/sass/yard/default/layout/html/footer.erb +0 -12
  389. data/vendor/sass/yard/inherited_hash.rb +0 -41
@@ -114,6 +114,19 @@
114
114
  }
115
115
  },
116
116
 
117
+ "a self-closing tag ('/' modifier + XHTML)" : {
118
+ "haml" : "%zzz/",
119
+ "html" : "<zzz />"
120
+ },
121
+
122
+ "a self-closing tag ('/' modifier + HTML5)" : {
123
+ "haml" : "%zzz/",
124
+ "html" : "<zzz>",
125
+ "config" : {
126
+ "format" : "html5"
127
+ }
128
+ },
129
+
117
130
  "a tag with a CSS class" : {
118
131
  "haml" : "%p.class1",
119
132
  "html" : "<p class='class1'></p>"
@@ -157,7 +170,7 @@
157
170
  "multiple simple Haml tags" : {
158
171
  "haml" : "%div\n %div\n %p",
159
172
  "html" : "<div>\n <div>\n <p></p>\n </div>\n</div>"
160
- }
173
+ }
161
174
  },
162
175
 
163
176
  "tags with unusual HTML characters" : {
@@ -204,22 +217,21 @@
204
217
  "haml" : ".--",
205
218
  "html" : "<div class='--'></div>"
206
219
  }
207
-
208
220
  },
209
221
 
210
222
  "tags with inline content" : {
211
223
 
212
- "a simple tag" : {
224
+ "Inline content simple tag" : {
213
225
  "haml" : "%p hello",
214
226
  "html" : "<p>hello</p>"
215
227
  },
216
228
 
217
- "a tag with CSS" : {
229
+ "Inline content tag with CSS" : {
218
230
  "haml" : "%p.class1 hello",
219
231
  "html" : "<p class='class1'>hello</p>"
220
232
  },
221
233
 
222
- "multiple simple tags" : {
234
+ "Inline content multiple simple tags" : {
223
235
  "haml" : "%div\n %div\n %p text",
224
236
  "html" : "<div>\n <div>\n <p>text</p>\n </div>\n</div>"
225
237
  }
@@ -227,41 +239,40 @@
227
239
 
228
240
  "tags with nested content" : {
229
241
 
230
- "a simple tag" : {
242
+ "Nested content simple tag" : {
231
243
  "haml" : "%p\n hello",
232
244
  "html" : "<p>\n hello\n</p>"
233
245
  },
234
246
 
235
- "a tag with CSS" : {
247
+ "Nested content tag with CSS" : {
236
248
  "haml" : "%p.class1\n hello",
237
249
  "html" : "<p class='class1'>\n hello\n</p>"
238
250
  },
239
251
 
240
- "multiple simple tags" : {
252
+ "Nested content multiple simple tags" : {
241
253
  "haml" : "%div\n %div\n %p\n text",
242
254
  "html" : "<div>\n <div>\n <p>\n text\n </p>\n </div>\n</div>"
243
255
  }
244
-
245
256
  },
246
257
 
247
258
  "tags with HTML-style attributes": {
248
259
 
249
- "one attribute" : {
260
+ "HTML-style one attribute" : {
250
261
  "haml" : "%p(a='b')",
251
262
  "html" : "<p a='b'></p>"
252
263
  },
253
264
 
254
- "multiple attributes" : {
265
+ "HTML-style multiple attributes" : {
255
266
  "haml" : "%p(a='b' c='d')",
256
267
  "html" : "<p a='b' c='d'></p>"
257
268
  },
258
269
 
259
- "attributes separated with newlines" : {
270
+ "HTML-style attributes separated with newlines" : {
260
271
  "haml" : "%p(a='b'\n c='d')",
261
272
  "html" : "<p a='b' c='d'></p>"
262
273
  },
263
274
 
264
- "an interpolated attribute" : {
275
+ "HTML-style interpolated attribute" : {
265
276
  "haml" : "%p(a=\"#{var}\")",
266
277
  "html" : "<p a='value'></p>",
267
278
  "locals" : {
@@ -269,27 +280,27 @@
269
280
  }
270
281
  },
271
282
 
272
- "'class' as an attribute" : {
283
+ "HTML-style 'class' as an attribute" : {
273
284
  "haml" : "%p(class='class1')",
274
285
  "html" : "<p class='class1'></p>"
275
286
  },
276
287
 
277
- "a tag with a CSS class and 'class' as an attribute" : {
288
+ "HTML-style tag with a CSS class and 'class' as an attribute" : {
278
289
  "haml" : "%p.class2(class='class1')",
279
290
  "html" : "<p class='class1 class2'></p>"
280
291
  },
281
292
 
282
- "a tag with 'id' as an attribute" : {
293
+ "HTML-style tag with 'id' as an attribute" : {
283
294
  "haml" : "%p(id='1')",
284
295
  "html" : "<p id='1'></p>"
285
296
  },
286
297
 
287
- "a tag with a CSS id and 'id' as an attribute" : {
298
+ "HTML-style tag with a CSS id and 'id' as an attribute" : {
288
299
  "haml" : "%p#id(id='1')",
289
300
  "html" : "<p id='id_1'></p>"
290
301
  },
291
302
 
292
- "a tag with a variable attribute" : {
303
+ "HTML-style tag with a variable attribute" : {
293
304
  "haml" : "%p(class=var)",
294
305
  "html" : "<p class='hello'></p>",
295
306
  "locals" : {
@@ -297,7 +308,7 @@
297
308
  }
298
309
  },
299
310
 
300
- "a tag with a CSS class and 'class' as a variable attribute" : {
311
+ "HTML-style tag with a CSS class and 'class' as a variable attribute" : {
301
312
  "haml" : ".hello(class=var)",
302
313
  "html" : "<div class='hello world'></div>",
303
314
  "locals" : {
@@ -305,119 +316,139 @@
305
316
  }
306
317
  },
307
318
 
308
- "a tag multiple CSS classes (sorted correctly)" : {
319
+ "HTML-style tag multiple CSS classes (sorted correctly)" : {
309
320
  "haml" : ".z(class=var)",
310
321
  "html" : "<div class='a z'></div>",
311
322
  "locals" : {
312
323
  "var" : "a"
313
324
  }
314
325
  }
315
-
316
326
  },
317
327
 
318
328
  "tags with Ruby-style attributes": {
319
329
 
320
- "one attribute" : {
330
+ "Ruby-style one attribute" : {
321
331
  "haml" : "%p{:a => 'b'}",
322
- "html" : "<p a='b'></p>"
332
+ "html" : "<p a='b'></p>",
333
+ "optional" : true
323
334
  },
324
335
 
325
- "attributes hash with whitespace" : {
336
+ "Ruby-style attributes hash with whitespace" : {
326
337
  "haml" : "%p{ :a => 'b' }",
327
- "html" : "<p a='b'></p>"
338
+ "html" : "<p a='b'></p>",
339
+ "optional" : true
328
340
  },
329
341
 
330
- "an interpolated attribute" : {
342
+ "Ruby-style interpolated attribute" : {
331
343
  "haml" : "%p{:a =>\"#{var}\"}",
332
344
  "html" : "<p a='value'></p>",
345
+ "optional" : true,
333
346
  "locals" : {
334
347
  "var" : "value"
335
348
  }
336
349
  },
337
350
 
338
- "multiple attributes" : {
351
+ "Ruby-style multiple attributes" : {
339
352
  "haml" : "%p{ :a => 'b', 'c' => 'd' }",
340
- "html" : "<p a='b' c='d'></p>"
353
+ "html" : "<p a='b' c='d'></p>",
354
+ "optional" : true
341
355
  },
342
356
 
343
- "attributes separated with newlines" : {
357
+ "Ruby-style attributes separated with newlines" : {
344
358
  "haml" : "%p{ :a => 'b',\n 'c' => 'd' }",
345
- "html" : "<p a='b' c='d'></p>"
359
+ "html" : "<p a='b' c='d'></p>",
360
+ "optional" : true
346
361
  },
347
362
 
348
- "'class' as an attribute" : {
363
+ "Ruby-style 'class' as an attribute" : {
349
364
  "haml" : "%p{:class => 'class1'}",
350
- "html" : "<p class='class1'></p>"
365
+ "html" : "<p class='class1'></p>",
366
+ "optional" : true
351
367
  },
352
368
 
353
- "a tag with a CSS class and 'class' as an attribute" : {
369
+ "Ruby-style tag with a CSS class and 'class' as an attribute" : {
354
370
  "haml" : "%p.class2{:class => 'class1'}",
355
- "html" : "<p class='class1 class2'></p>"
371
+ "html" : "<p class='class1 class2'></p>",
372
+ "optional" : true
356
373
  },
357
374
 
358
- "a tag with 'id' as an attribute" : {
375
+ "Ruby-style tag with 'id' as an attribute" : {
359
376
  "haml" : "%p{:id => '1'}",
360
- "html" : "<p id='1'></p>"
377
+ "html" : "<p id='1'></p>",
378
+ "optional" : true
361
379
  },
362
380
 
363
- "a tag with a CSS id and 'id' as an attribute" : {
381
+ "Ruby-style tag with a CSS id and 'id' as an attribute" : {
364
382
  "haml" : "%p#id{:id => '1'}",
365
- "html" : "<p id='id_1'></p>"
383
+ "html" : "<p id='id_1'></p>",
384
+ "optional" : true
366
385
  },
367
386
 
368
- "a tag with a CSS id and a numeric 'id' as an attribute" : {
387
+ "Ruby-style tag with a CSS id and a numeric 'id' as an attribute" : {
369
388
  "haml" : "%p#id{:id => 1}",
370
- "html" : "<p id='id_1'></p>"
389
+ "html" : "<p id='id_1'></p>",
390
+ "optional" : true
371
391
  },
372
392
 
373
- "a tag with a variable attribute" : {
393
+ "Ruby-style tag with a variable attribute" : {
374
394
  "haml" : "%p{:class => var}",
375
395
  "html" : "<p class='hello'></p>",
396
+ "optional" : true,
376
397
  "locals" : {
377
398
  "var" : "hello"
378
399
  }
379
400
  },
380
401
 
381
- "a tag with a CSS class and 'class' as a variable attribute" : {
402
+ "Ruby-style tag with a CSS class and 'class' as a variable attribute" : {
382
403
  "haml" : ".hello{:class => var}",
383
404
  "html" : "<div class='hello world'></div>",
405
+ "optional" : true,
384
406
  "locals" : {
385
407
  "var" : "world"
386
408
  }
387
409
  },
388
410
 
389
- "a tag multiple CSS classes (sorted correctly)" : {
411
+ "Ruby-style tag multiple CSS classes (sorted correctly)" : {
390
412
  "haml" : ".z{:class => var}",
391
413
  "html" : "<div class='a z'></div>",
414
+ "optional" : true,
392
415
  "locals" : {
393
416
  "var" : "a"
394
417
  }
395
418
  }
396
-
397
419
  },
398
420
 
399
421
  "silent comments" : {
400
422
 
401
- "an inline comment" : {
423
+ "an inline silent comment" : {
402
424
  "haml" : "-# hello",
403
425
  "html" : ""
404
426
  },
405
427
 
406
- "a nested comment" : {
428
+ "a nested silent comment" : {
407
429
  "haml" : "-#\n hello",
408
430
  "html" : ""
409
- }
431
+ },
432
+
433
+ "a multiply nested silent comment" : {
434
+ "haml" : "-#\n %div\n foo",
435
+ "html" : ""
436
+ },
410
437
 
438
+ "a multiply nested silent comment with inconsistent indents" : {
439
+ "haml" : "-#\n %div\n foo",
440
+ "html" : ""
441
+ }
411
442
  },
412
443
 
413
444
  "markup comments" : {
414
445
 
415
- "an inline comment" : {
446
+ "an inline markup comment" : {
416
447
  "haml" : "/ comment",
417
448
  "html" : "<!-- comment -->"
418
449
  },
419
450
 
420
- "a nested comment" : {
451
+ "a nested markup comment" : {
421
452
  "haml" : "/\n comment\n comment2",
422
453
  "html" : "<!--\n comment\n comment2\n-->"
423
454
  }
@@ -447,6 +478,11 @@
447
478
  "html" : "hello\n<p></p>"
448
479
  },
449
480
 
481
+ "content in a 'css' filter" : {
482
+ "haml" : ":css\n hello\n\n%p",
483
+ "html" : "<style type='text/css'>\n /*<![CDATA[*/\n hello\n /*]]>*/\n</style>\n<p></p>"
484
+ },
485
+
450
486
  "content in a 'javascript' filter" : {
451
487
  "haml" : ":javascript\n a();\n%p",
452
488
  "html" : "<script type='text/javascript'>\n //<![CDATA[\n a();\n //]]>\n</script>\n<p></p>"
@@ -454,11 +490,12 @@
454
490
 
455
491
  },
456
492
 
457
- "interpolation": {
493
+ "Ruby-style interpolation": {
458
494
 
459
495
  "interpolation inside inline content" : {
460
496
  "haml" : "%p #{var}",
461
497
  "html" : "<p>value</p>",
498
+ "optional" : true,
462
499
  "locals" : {
463
500
  "var" : "value"
464
501
  }
@@ -466,12 +503,17 @@
466
503
 
467
504
  "no interpolation when escaped" : {
468
505
  "haml" : "%p \\#{var}",
469
- "html" : "<p>#{var}</p>"
506
+ "html" : "<p>#{var}</p>",
507
+ "optional" : true,
508
+ "locals" : {
509
+ "var" : "value"
510
+ }
470
511
  },
471
512
 
472
513
  "interpolation when the escape character is escaped" : {
473
514
  "haml" : "%p \\\\#{var}",
474
515
  "html" : "<p>\\value</p>",
516
+ "optional" : true,
475
517
  "locals" : {
476
518
  "var" : "value"
477
519
  }
@@ -480,11 +522,11 @@
480
522
  "interpolation inside filtered content" : {
481
523
  "haml" : ":plain\n #{var} interpolated: #{var}",
482
524
  "html" : "value interpolated: value",
525
+ "optional" : true,
483
526
  "locals" : {
484
527
  "var" : "value"
485
528
  }
486
529
  }
487
-
488
530
  },
489
531
 
490
532
  "HTML escaping" : {
@@ -512,7 +554,7 @@
512
554
 
513
555
  },
514
556
 
515
- "Boolean attributes" : {
557
+ "boolean attributes" : {
516
558
 
517
559
  "boolean attribute with XHTML" : {
518
560
  "haml" : "%input(checked=true)",
@@ -529,6 +571,42 @@
529
571
  "format" : "html5"
530
572
  }
531
573
  }
532
- }
574
+ },
575
+
576
+ "whitespace preservation" : {
577
+
578
+ "following the '~' operator" : {
579
+ "haml" : "~ \"Foo\\n<pre>Bar\\nBaz</pre>\"",
580
+ "html" : "Foo\n<pre>Bar&#x000A;Baz</pre>",
581
+ "optional" : true
582
+ },
533
583
 
584
+ "inside a textarea tag" : {
585
+ "haml" : "%textarea\n hello\n hello",
586
+ "html" : "<textarea>hello\nhello</textarea>"
587
+ },
588
+
589
+ "inside a pre tag" : {
590
+ "haml" : "%pre\n hello\n hello",
591
+ "html" : "<pre>hello\nhello</pre>"
592
+ }
593
+ },
594
+
595
+ "whitespace removal" : {
596
+
597
+ "a tag with '>' appended and inline content" : {
598
+ "haml" : "%li hello\n%li> world\n%li again",
599
+ "html" : "<li>hello</li><li>world</li><li>again</li>"
600
+ },
601
+
602
+ "a tag with '>' appended and nested content" : {
603
+ "haml" : "%li hello\n%li>\n world\n%li again",
604
+ "html" : "<li>hello</li><li>\n world\n</li><li>again</li>"
605
+ },
606
+
607
+ "a tag with '<' appended" : {
608
+ "haml" : "%p<\n hello\n world",
609
+ "html" : "<p>hello\nworld</p>"
610
+ }
611
+ }
534
612
  }
@@ -1,5 +1,4 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
1
+ require 'test_helper'
3
2
 
4
3
  class ActionView::Base
5
4
  def nested_tag
@@ -17,7 +16,7 @@ module Haml::Helpers
17
16
  end
18
17
  end
19
18
 
20
- class HelperTest < Test::Unit::TestCase
19
+ class HelperTest < MiniTest::Unit::TestCase
21
20
  Post = Struct.new('Post', :body, :error_field, :errors)
22
21
  class PostErrors
23
22
  def on(name)
@@ -30,7 +29,7 @@ class HelperTest < Test::Unit::TestCase
30
29
  on(name) || []
31
30
  end
32
31
  end
33
-
32
+
34
33
  def setup
35
34
  @base = ActionView::Base.new
36
35
  @base.controller = ActionController::Base.new
@@ -68,6 +67,10 @@ class HelperTest < Test::Unit::TestCase
68
67
  assert_equal("<li>[1]</li>\n", render("= list_of([[1]]) do |i|\n = i.inspect"))
69
68
  assert_equal("<li>\n <h1>Fee</h1>\n <p>A word!</p>\n</li>\n<li>\n <h1>Fi</h1>\n <p>A word!</p>\n</li>\n<li>\n <h1>Fo</h1>\n <p>A word!</p>\n</li>\n<li>\n <h1>Fum</h1>\n <p>A word!</p>\n</li>\n",
70
69
  render("= list_of(['Fee', 'Fi', 'Fo', 'Fum']) do |title|\n %h1= title\n %p A word!"))
70
+ assert_equal("<li c='3'>1</li>\n<li c='3'>2</li>\n", render("= list_of([1, 2], {:c => 3}) do |i|\n = i"))
71
+ assert_equal("<li c='3'>[1]</li>\n", render("= list_of([[1]], {:c => 3}) do |i|\n = i.inspect"))
72
+ assert_equal("<li c='3'>\n <h1>Fee</h1>\n <p>A word!</p>\n</li>\n<li c='3'>\n <h1>Fi</h1>\n <p>A word!</p>\n</li>\n<li c='3'>\n <h1>Fo</h1>\n <p>A word!</p>\n</li>\n<li c='3'>\n <h1>Fum</h1>\n <p>A word!</p>\n</li>\n",
73
+ render("= list_of(['Fee', 'Fi', 'Fo', 'Fum'], {:c => 3}) do |title|\n %h1= title\n %p A word!"))
71
74
  end
72
75
 
73
76
  def test_buffer_access
@@ -110,40 +113,53 @@ HAML
110
113
  ActionView::Base.new.render(:inline => "<%= concat('foo') %>")
111
114
  rescue ArgumentError, NameError
112
115
  proper_behavior = true
113
- end
116
+ end
114
117
  assert(proper_behavior)
115
118
  end
116
-
119
+
117
120
  def test_action_view_included
118
121
  assert(Haml::Helpers.action_view?)
119
122
  end
120
-
123
+
121
124
  def test_form_tag
122
125
  # This is usually provided by ActionController::Base.
123
126
  def @base.protect_against_forgery?; false; end
124
127
  assert_equal(<<HTML, render(<<HAML, :action_view))
125
- <form #{rails_form_attr}action="foo" method="post">#{rails_form_opener}
128
+ <form accept-charset="UTF-8" action="foo" method="post">#{rails_form_opener}
126
129
  <p>bar</p>
127
130
  <strong>baz</strong>
128
131
  </form>
129
132
  HTML
130
- #{rails_block_helper_char} form_tag 'foo' do
133
+ = form_tag 'foo' do
131
134
  %p bar
132
135
  %strong baz
133
136
  HAML
134
137
  end
135
138
 
136
- def test_text_area
137
- assert_equal(%(<textarea id="body" name="body">Foo&#x000A;Bar&#x000A; Baz&#x000A; Boom</textarea>\n),
138
- render('= text_area_tag "body", "Foo\nBar\n Baz\n Boom"', :action_view))
139
+ if Rails.version >= "3.2.3"
140
+ def test_text_area
141
+ assert_equal(%(<textarea id="body" name="body">\nFoo&#x000A;Bar&#x000A; Baz&#x000A; Boom</textarea>\n),
142
+ render('= text_area_tag "body", "Foo\nBar\n Baz\n Boom"', :action_view))
143
+
144
+ assert_equal(%(<textarea cols="40" id="post_body" name="post[body]" rows="20">\nFoo bar&#x000A;baz</textarea>\n),
145
+ render('= text_area :post, :body', :action_view))
139
146
 
140
- assert_equal(%(<textarea cols="40" id="post_body" name="post[body]" rows="20">Foo bar&#x000A;baz</textarea>\n),
141
- render('= text_area :post, :body', :action_view))
147
+ assert_equal(%(<pre>Foo bar&#x000A; baz</pre>\n),
148
+ render('= content_tag "pre", "Foo bar\n baz"', :action_view))
149
+ end
150
+ else
151
+ def test_text_area
152
+ assert_equal(%(<textarea id="body" name="body">Foo&#x000A;Bar&#x000A; Baz&#x000A; Boom</textarea>\n),
153
+ render('= text_area_tag "body", "Foo\nBar\n Baz\n Boom"', :action_view))
154
+
155
+ assert_equal(%(<textarea cols="40" id="post_body" name="post[body]" rows="20">Foo bar&#x000A;baz</textarea>\n),
156
+ render('= text_area :post, :body', :action_view))
142
157
 
143
- assert_equal(%(<pre>Foo bar&#x000A; baz</pre>\n),
144
- render('= content_tag "pre", "Foo bar\n baz"', :action_view))
158
+ assert_equal(%(<pre>Foo bar&#x000A; baz</pre>\n),
159
+ render('= content_tag "pre", "Foo bar\n baz"', :action_view))
160
+ end
145
161
  end
146
-
162
+
147
163
  def test_capture_haml
148
164
  assert_equal(<<HTML, render(<<HAML))
149
165
  "<p>13</p>\\n"
@@ -151,7 +167,7 @@ HTML
151
167
  - (foo = capture_haml(13) do |a|
152
168
  %p= a
153
169
  - end; nil)
154
- = foo.dump
170
+ = foo.inspect
155
171
  HAML
156
172
  end
157
173
 
@@ -161,7 +177,7 @@ HAML
161
177
  <strong>bar</strong>
162
178
  </div>
163
179
  HTML
164
- #{rails_block_helper_char} content_tag :div do
180
+ = content_tag :div do
165
181
  %p bar
166
182
  %strong bar
167
183
  HAML
@@ -169,13 +185,12 @@ HAML
169
185
 
170
186
  def test_content_tag_error_wrapping
171
187
  def @base.protect_against_forgery?; false; end
172
- error_class = Haml::Util.ap_geq_3? ? "field_with_errors" : "fieldWithErrors"
173
188
  assert_equal(<<HTML, render(<<HAML, :action_view))
174
- <form #{rails_form_attr}action="" method="post">#{rails_form_opener}
175
- <div class="#{error_class}"><label for="post_error_field">Error field</label></div>
189
+ <form accept-charset="UTF-8" action="" method="post">#{rails_form_opener}
190
+ <div class="field_with_errors"><label for="post_error_field">Error field</label></div>
176
191
  </form>
177
192
  HTML
178
- #{rails_block_helper_char} form_for #{form_for_calling_convention('post')}, :url => '' do |f|
193
+ = form_for @post, :as => :post, :html => {:class => nil, :id => nil}, :url => '' do |f|
179
194
  = f.label 'error_field'
180
195
  HAML
181
196
  end
@@ -183,9 +198,9 @@ HAML
183
198
  def test_form_tag_in_helper_with_string_block
184
199
  def @base.protect_against_forgery?; false; end
185
200
  assert_equal(<<HTML, render(<<HAML, :action_view))
186
- <form #{rails_form_attr}action="/foo" method="post">#{rails_form_opener}bar</form>
201
+ <form accept-charset="UTF-8" action="/foo" method="post">#{rails_form_opener}bar</form>
187
202
  HTML
188
- #{rails_block_helper_char} wacky_form
203
+ = wacky_form
189
204
  HAML
190
205
  end
191
206
 
@@ -229,8 +244,8 @@ HAML
229
244
  assert_equal("<p class='foo bar' id='some_id'></p>\n", render("- haml_tag 'p.foo.bar#some_id'"))
230
245
  end
231
246
 
232
- def test_haml_tag_name_and_attribute_classes_merging
233
- assert_equal("<p class='foo bar' id='some_id'></p>\n", render("- haml_tag 'p#some_id.foo', :class => 'bar'"))
247
+ def test_haml_tag_name_and_attribute_classes_merging_with_id
248
+ assert_equal("<p class='bar foo' id='some_id'></p>\n", render("- haml_tag 'p#some_id.foo', :class => 'bar'"))
234
249
  end
235
250
 
236
251
  def test_haml_tag_name_and_attribute_classes_merging
@@ -273,19 +288,19 @@ HAML
273
288
  end
274
289
 
275
290
  def test_haml_tag_raises_error_for_multiple_content
276
- assert_raise(Haml::Error) { render("- haml_tag :p, 'foo' do\n bar") }
291
+ assert_raises(Haml::Error) { render("- haml_tag :p, 'foo' do\n bar") }
277
292
  end
278
293
 
279
294
  def test_haml_tag_flags
280
295
  assert_equal("<p />\n", render("- haml_tag :p, :/"))
281
296
  assert_equal("<p>kumquat</p>\n", render("- haml_tag :p, :< do\n kumquat"))
282
297
 
283
- assert_raise(Haml::Error) { render("- haml_tag :p, 'foo', :/") }
284
- assert_raise(Haml::Error) { render("- haml_tag :p, :/ do\n foo") }
298
+ assert_raises(Haml::Error) { render("- haml_tag :p, 'foo', :/") }
299
+ assert_raises(Haml::Error) { render("- haml_tag :p, :/ do\n foo") }
285
300
  end
286
301
 
287
302
  def test_haml_tag_error_return
288
- assert_raise(Haml::Error) { render("= haml_tag :p") }
303
+ assert_raises(Haml::Error) { render("= haml_tag :p") }
289
304
  end
290
305
 
291
306
  def test_haml_tag_with_multiline_string
@@ -341,12 +356,11 @@ HAML
341
356
  end
342
357
 
343
358
  def test_indented_capture
344
- prior = Haml::Util.ap_geq_3? ? "" : " \n"
345
- assert_equal("#{prior} Foo\n ", @base.render(:inline => " <% res = capture do %>\n Foo\n <% end %><%= res %>"))
359
+ assert_equal(" Foo\n ", @base.render(:inline => " <% res = capture do %>\n Foo\n <% end %><%= res %>"))
346
360
  end
347
361
 
348
362
  def test_capture_deals_properly_with_collections
349
- Haml::Helpers.module_eval do
363
+ Haml::Helpers.module_eval do
350
364
  def trc(collection, &block)
351
365
  collection.each do |record|
352
366
  haml_concat capture_haml(record, &block)
@@ -401,7 +415,7 @@ HAML
401
415
  end
402
416
 
403
417
  def test_error_return
404
- assert_raise(Haml::Error, <<MESSAGE) {render("= haml_concat 'foo'")}
418
+ assert_raises(Haml::Error, <<MESSAGE) {render("= haml_concat 'foo'")}
405
419
  haml_concat outputs directly to the Haml template.
406
420
  Disregard its return value and use the - operator,
407
421
  or use capture_haml to get the value as a String.
@@ -419,7 +433,7 @@ MESSAGE
419
433
  render("- something_that_uses_haml_concat")
420
434
  assert false, "Expected Haml::Error"
421
435
  rescue Haml::Error => e
422
- assert_equal 16, e.backtrace[0].scan(/:(\d+)/).first.first.to_i
436
+ assert_equal 15, e.backtrace[0].scan(/:(\d+)/).first.first.to_i
423
437
  end
424
438
 
425
439
  class ActsLikeTag