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
@@ -1,101 +0,0 @@
1
- require 'set'
2
-
3
- module Sass
4
- module Util
5
- # A map from sets to values.
6
- # A value is \{#\[]= set} by providing a set (the "set-set") and a value,
7
- # which is then recorded as corresponding to that set.
8
- # Values are \{#\[] accessed} by providing a set (the "get-set")
9
- # and returning all values that correspond to set-sets
10
- # that are subsets of the get-set.
11
- #
12
- # SubsetMap preserves the order of values as they're inserted.
13
- #
14
- # @example
15
- # ssm = SubsetMap.new
16
- # ssm[Set[1, 2]] = "Foo"
17
- # ssm[Set[2, 3]] = "Bar"
18
- # ssm[Set[1, 2, 3]] = "Baz"
19
- #
20
- # ssm[Set[1, 2, 3]] #=> ["Foo", "Bar", "Baz"]
21
- class SubsetMap
22
- # Creates a new, empty SubsetMap.
23
- def initialize
24
- @hash = {}
25
- @vals = []
26
- end
27
-
28
- # Whether or not this SubsetMap has any key-value pairs.
29
- #
30
- # @return [Boolean]
31
- def empty?
32
- @hash.empty?
33
- end
34
-
35
- # Associates a value with a set.
36
- # When `set` or any of its supersets is accessed,
37
- # `value` will be among the values returned.
38
- #
39
- # Note that if the same `set` is passed to this method multiple times,
40
- # all given `value`s will be associated with that `set`.
41
- #
42
- # This runs in `O(n)` time, where `n` is the size of `set`.
43
- #
44
- # @param set [#to_set] The set to use as the map key. May not be empty.
45
- # @param value [Object] The value to associate with `set`.
46
- # @raise [ArgumentError] If `set` is empty.
47
- def []=(set, value)
48
- raise ArgumentError.new("SubsetMap keys may not be empty.") if set.empty?
49
-
50
- index = @vals.size
51
- @vals << value
52
- set.each do |k|
53
- @hash[k] ||= []
54
- @hash[k] << [set, set.to_set, index]
55
- end
56
- end
57
-
58
- # Returns all values associated with subsets of `set`.
59
- #
60
- # In the worst case, this runs in `O(m*max(n, log m))` time,
61
- # where `n` is the size of `set`
62
- # and `m` is the number of assocations in the map.
63
- # However, unless many keys in the map overlap with `set`,
64
- # `m` will typically be much smaller.
65
- #
66
- # @param set [Set] The set to use as the map key.
67
- # @return [Array<(Object, #to_set)>] An array of pairs,
68
- # where the first value is the value associated with a subset of `set`,
69
- # and the second value is that subset of `set`
70
- # (or whatever `#to_set` object was used to set the value)
71
- # This array is in insertion order.
72
- # @see #[]
73
- def get(set)
74
- res = set.map do |k|
75
- next unless subsets = @hash[k]
76
- subsets.map do |subenum, subset, index|
77
- next unless subset.subset?(set)
78
- [index, subenum]
79
- end
80
- end
81
- res = Sass::Util.flatten(res, 1)
82
- res.compact!
83
- res.uniq!
84
- res.sort!
85
- res.map! {|i, s| [@vals[i], s]}
86
- return res
87
- end
88
-
89
- # Same as \{#get}, but doesn't return the subsets of the argument
90
- # for which values were found.
91
- #
92
- # @param set [Set] The set to use as the map key.
93
- # @return [Array] The array of all values
94
- # associated with subsets of `set`, in insertion order.
95
- # @see #get
96
- def [](set)
97
- get(set).map {|v, _| v}
98
- end
99
- end
100
- end
101
- end
@@ -1,112 +0,0 @@
1
- # This is necessary for loading Sass when Haml is required in Rails 3.
2
- # Once the split is complete, we can remove it.
3
- require File.dirname(__FILE__) + '/../sass'
4
- require 'sass/util'
5
-
6
- module Sass
7
- # Handles Sass version-reporting.
8
- # Sass not only reports the standard three version numbers,
9
- # but its Git revision hash as well,
10
- # if it was installed from Git.
11
- module Version
12
- include Sass::Util
13
-
14
- # Returns a hash representing the version of Sass.
15
- # The `:major`, `:minor`, and `:teeny` keys have their respective numbers as Fixnums.
16
- # The `:name` key has the name of the version.
17
- # The `:string` key contains a human-readable string representation of the version.
18
- # The `:number` key is the major, minor, and teeny keys separated by periods.
19
- # If Sass is checked out from Git, the `:rev` key will have the revision hash.
20
- # For example:
21
- #
22
- # {
23
- # :string => "2.1.0.9616393",
24
- # :rev => "9616393b8924ef36639c7e82aa88a51a24d16949",
25
- # :number => "2.1.0",
26
- # :major => 2, :minor => 1, :teeny => 0
27
- # }
28
- #
29
- # If a prerelease version of Sass is being used,
30
- # the `:string` and `:number` fields will reflect the full version
31
- # (e.g. `"2.2.beta.1"`), and the `:teeny` field will be `-1`.
32
- # A `:prerelease` key will contain the name of the prerelease (e.g. `"beta"`),
33
- # and a `:prerelease_number` key will contain the rerelease number.
34
- # For example:
35
- #
36
- # {
37
- # :string => "3.0.beta.1",
38
- # :number => "3.0.beta.1",
39
- # :major => 3, :minor => 0, :teeny => -1,
40
- # :prerelease => "beta",
41
- # :prerelease_number => 1
42
- # }
43
- #
44
- # @return [{Symbol => String/Fixnum}] The version hash
45
- def version
46
- return @@version if defined?(@@version)
47
-
48
- numbers = File.read(scope('VERSION')).strip.split('.').
49
- map {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
50
- name = File.read(scope('VERSION_NAME')).strip
51
- @@version = {
52
- :major => numbers[0],
53
- :minor => numbers[1],
54
- :teeny => numbers[2],
55
- :name => name
56
- }
57
-
58
- if numbers[3].is_a?(String)
59
- @@version[:teeny] = -1
60
- @@version[:prerelease] = numbers[3]
61
- @@version[:prerelease_number] = numbers[4]
62
- end
63
-
64
- @@version[:number] = numbers.join('.')
65
- @@version[:string] = @@version[:number].dup
66
-
67
- if rev = revision_number
68
- @@version[:rev] = rev
69
- unless rev[0] == ?(
70
- @@version[:string] << "." << rev[0...7]
71
- end
72
- end
73
-
74
- @@version[:string] << " (#{name})"
75
- @@version
76
- end
77
-
78
- private
79
-
80
- def revision_number
81
- if File.exists?(scope('REVISION'))
82
- rev = File.read(scope('REVISION')).strip
83
- return rev unless rev =~ /^([a-f0-9]+|\(.*\))$/ || rev == '(unknown)'
84
- end
85
-
86
- return unless File.exists?(scope('.git/HEAD'))
87
- rev = File.read(scope('.git/HEAD')).strip
88
- return rev unless rev =~ /^ref: (.*)$/
89
-
90
- ref_name = $1
91
- ref_file = scope(".git/#{ref_name}")
92
- info_file = scope(".git/info/refs")
93
- return File.read(ref_file).strip if File.exists?(ref_file)
94
- return unless File.exists?(info_file)
95
- File.open(info_file) do |f|
96
- f.each do |l|
97
- sha, ref = l.strip.split("\t", 2)
98
- next unless ref == ref_name
99
- return sha
100
- end
101
- end
102
- return nil
103
- end
104
- end
105
-
106
- extend Sass::Version
107
-
108
- # A string representing the version of Sass.
109
- # A more fine-grained representation is available from Sass.version.
110
- # @api public
111
- VERSION = version[:string] unless defined?(Sass::VERSION)
112
- end
@@ -1 +0,0 @@
1
- Kernel.load File.join(File.dirname(__FILE__), '..', 'init.rb')
@@ -1,33 +0,0 @@
1
- require 'rubygems'
2
-
3
- # Note that Sass's gem-compilation process requires access to the filesystem.
4
- # This means that it cannot be automatically run by e.g. GitHub's gem system.
5
- # However, a build server automatically packages the master branch
6
- # every time it's pushed to; this is made available as a prerelease gem.
7
- SASS_GEMSPEC = Gem::Specification.new do |spec|
8
- spec.rubyforge_project = 'sass'
9
- spec.name = 'sass'
10
- spec.summary = "A powerful but elegant CSS compiler that makes CSS fun again."
11
- spec.version = File.read(File.dirname(__FILE__) + '/VERSION').strip
12
- spec.authors = ['Nathan Weizenbaum', 'Chris Eppstein', 'Hampton Catlin']
13
- spec.email = 'sass-lang@googlegroups.com'
14
- spec.description = <<-END
15
- Sass makes CSS fun again. Sass is an extension of CSS3, adding
16
- nested rules, variables, mixins, selector inheritance, and more.
17
- It's translated to well-formatted, standard CSS using the
18
- command line tool or a web-framework plugin.
19
- END
20
-
21
- spec.required_ruby_version = '>= 1.8.7'
22
- spec.add_development_dependency 'yard', '>= 0.5.3'
23
- spec.add_development_dependency 'maruku', '>= 0.5.9'
24
-
25
- readmes = Dir['*'].reject{ |x| x =~ /(^|[^.a-z])[a-z]+/ || x == "TODO" }
26
- spec.executables = ['sass', 'sass-convert', 'scss']
27
- spec.files = Dir['rails/init.rb', 'lib/**/*', 'vendor/**/*',
28
- 'bin/*', 'test/**/*', 'extra/**/*', 'Rakefile', 'init.rb',
29
- '.yardopts'] + readmes
30
- spec.homepage = 'http://sass-lang.com/'
31
- spec.has_rdoc = false
32
- spec.test_files = Dir['test/**/*_test.rb']
33
- end
@@ -1,4 +0,0 @@
1
- source :gemcutter
2
-
3
- gem 'rake'
4
- gem 'less', '< 2.0.0'
@@ -1,19 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- less (1.2.21)
5
- mutter (>= 0.4.2)
6
- treetop (>= 1.4.2)
7
- mutter (0.5.3)
8
- polyglot (0.3.2)
9
- rake (0.9.2)
10
- treetop (1.4.10)
11
- polyglot
12
- polyglot (>= 0.3.1)
13
-
14
- PLATFORMS
15
- ruby
16
-
17
- DEPENDENCIES
18
- less (< 2.0.0)
19
- rake
@@ -1,89 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
- require File.dirname(__FILE__) + '/test_helper'
4
- require 'sass/engine'
5
-
6
- class CacheTest < Test::Unit::TestCase
7
- @@cache_dir = "tmp/file_cache"
8
-
9
- def setup
10
- FileUtils.mkdir_p @@cache_dir
11
- end
12
-
13
- def teardown
14
- FileUtils.rm_rf @@cache_dir
15
- clean_up_sassc
16
- end
17
-
18
- def test_file_cache_writes_a_file
19
- file_store = Sass::CacheStores::Filesystem.new(@@cache_dir)
20
- file_store.store("asdf/foo.scssc", "fakesha1", root_node)
21
- assert File.exists?("#{@@cache_dir}/asdf/foo.scssc")
22
- end
23
-
24
- def test_file_cache_reads_a_file
25
- file_store = Sass::CacheStores::Filesystem.new(@@cache_dir)
26
- assert !File.exists?("#{@@cache_dir}/asdf/foo.scssc")
27
- file_store.store("asdf/foo.scssc", "fakesha1", root_node)
28
- assert File.exists?("#{@@cache_dir}/asdf/foo.scssc")
29
- assert_kind_of Sass::Tree::RootNode, file_store.retrieve("asdf/foo.scssc", "fakesha1")
30
- end
31
-
32
- def test_file_cache_miss_returns_nil
33
- file_store = Sass::CacheStores::Filesystem.new(@@cache_dir)
34
- assert !File.exists?("#{@@cache_dir}/asdf/foo.scssc")
35
- assert_nil file_store.retrieve("asdf/foo.scssc", "fakesha1")
36
- end
37
-
38
- def test_sha_change_invalidates_cache_and_cleans_up
39
- file_store = Sass::CacheStores::Filesystem.new(@@cache_dir)
40
- assert !File.exists?("#{@@cache_dir}/asdf/foo.scssc")
41
- file_store.store("asdf/foo.scssc", "fakesha1", root_node)
42
- assert File.exists?("#{@@cache_dir}/asdf/foo.scssc")
43
- assert_nil file_store.retrieve("asdf/foo.scssc", "differentsha1")
44
- assert !File.exists?("#{@@cache_dir}/asdf/foo.scssc")
45
- end
46
-
47
- def test_version_change_invalidates_cache_and_cleans_up
48
- file_store = Sass::CacheStores::Filesystem.new(@@cache_dir)
49
- assert !File.exists?("#{@@cache_dir}/asdf/foo.scssc")
50
- file_store.store("asdf/foo.scssc", "fakesha1", root_node)
51
- assert File.exists?("#{@@cache_dir}/asdf/foo.scssc")
52
- real_version = Sass::VERSION
53
- begin
54
- Sass::VERSION.replace("a different version")
55
- assert_nil file_store.retrieve("asdf/foo.scssc", "fakesha1")
56
- assert !File.exists?("#{@@cache_dir}/asdf/foo.scssc")
57
- ensure
58
- Sass::VERSION.replace(real_version)
59
- end
60
- end
61
-
62
- def test_arbitrary_objects_can_go_into_cache
63
- cache = Sass::CacheStores::Memory.new
64
- an_object = {:foo => :bar}
65
- cache.store("an_object", "", an_object)
66
- assert_equal an_object, cache.retrieve("an_object", "")
67
- end
68
-
69
- class Unmarshalable
70
- def _dump(_)
71
- raise 'Unmarshalable'
72
- end
73
- end
74
-
75
- def test_cache_node_with_unmarshalable_option
76
- engine = Sass::Engine.new("foo {a: b + c}",
77
- :syntax => :scss, :object => Unmarshalable.new, :filename => 'file.scss',
78
- :importer => Sass::Importers::Filesystem.new(absolutize('templates')))
79
- engine.to_tree
80
- end
81
-
82
- private
83
- def root_node
84
- Sass::Engine.new(<<-SCSS, :syntax => :scss).to_tree
85
- @mixin color($c) { color: $c}
86
- div { @include color(red); }
87
- SCSS
88
- end
89
- end
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
- require 'sass/callbacks'
4
-
5
- class CallerBack
6
- extend Sass::Callbacks
7
- define_callback :foo
8
- define_callback :bar
9
-
10
- def do_foo
11
- run_foo
12
- end
13
-
14
- def do_bar
15
- run_bar 12
16
- end
17
- end
18
-
19
- module ClassLevelCallerBack
20
- extend Sass::Callbacks
21
- define_callback :foo
22
- extend self
23
-
24
- def do_foo
25
- run_foo
26
- end
27
- end
28
-
29
- class SassCallbacksTest < Test::Unit::TestCase
30
- def test_simple_callback
31
- cb = CallerBack.new
32
- there = false
33
- cb.on_foo {there = true}
34
- cb.do_foo
35
- assert there, "Expected callback to be called."
36
- end
37
-
38
- def test_multiple_callbacks
39
- cb = CallerBack.new
40
- str = ""
41
- cb.on_foo {str += "first"}
42
- cb.on_foo {str += " second"}
43
- cb.do_foo
44
- assert_equal "first second", str
45
- end
46
-
47
- def test_callback_with_arg
48
- cb = CallerBack.new
49
- val = nil
50
- cb.on_bar {|a| val = a}
51
- cb.do_bar
52
- assert_equal 12, val
53
- end
54
-
55
- def test_class_level_callback
56
- there = false
57
- ClassLevelCallerBack.on_foo {there = true}
58
- ClassLevelCallerBack.do_foo
59
- assert there, "Expected callback to be called."
60
- end
61
- end
@@ -1,1199 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
-
4
- class ConversionTest < Test::Unit::TestCase
5
- def test_basic
6
- assert_renders <<SASS, <<SCSS
7
- foo bar
8
- baz: bang
9
- bip: bop
10
- SASS
11
- foo bar {
12
- baz: bang;
13
- bip: bop; }
14
- SCSS
15
- assert_renders <<SASS, <<SCSS, :old => true
16
- foo bar
17
- :baz bang
18
- :bip bop
19
- SASS
20
- foo bar {
21
- baz: bang;
22
- bip: bop; }
23
- SCSS
24
- end
25
-
26
- def test_empty_selector
27
- assert_renders "foo bar", "foo bar {}"
28
- end
29
-
30
- def test_empty_directive
31
- assert_scss_to_sass "@media screen", "@media screen {}"
32
- assert_scss_to_scss "@media screen {}"
33
- end
34
-
35
- def test_empty_control_directive
36
- assert_renders "@if false", "@if false {}"
37
- end
38
-
39
- def test_nesting
40
- assert_renders <<SASS, <<SCSS
41
- foo bar
42
- baz bang
43
- baz: bang
44
- bip: bop
45
- blat: boo
46
- SASS
47
- foo bar {
48
- baz bang {
49
- baz: bang;
50
- bip: bop; }
51
- blat: boo; }
52
- SCSS
53
- end
54
-
55
- def test_nesting_with_parent_ref
56
- assert_renders <<SASS, <<SCSS
57
- foo bar
58
- &:hover
59
- baz: bang
60
- SASS
61
- foo bar {
62
- &:hover {
63
- baz: bang; } }
64
- SCSS
65
- end
66
-
67
- def test_selector_interpolation
68
- assert_renders <<SASS, <<SCSS
69
- foo \#{$bar + "baz"}.bip
70
- baz: bang
71
- SASS
72
- foo \#{$bar + "baz"}.bip {
73
- baz: bang; }
74
- SCSS
75
- end
76
-
77
- def test_multiline_selector_with_commas
78
- assert_renders <<SASS, <<SCSS
79
- foo bar,
80
- baz bang
81
- baz: bang
82
- SASS
83
- foo bar,
84
- baz bang {
85
- baz: bang; }
86
- SCSS
87
-
88
- assert_renders <<SASS, <<SCSS
89
- blat
90
- foo bar,
91
- baz bang
92
- baz: bang
93
- SASS
94
- blat {
95
- foo bar,
96
- baz bang {
97
- baz: bang; } }
98
- SCSS
99
- end
100
-
101
- def test_multiline_selector_without_commas
102
- assert_scss_to_sass <<SASS, <<SCSS
103
- foo bar baz bang
104
- baz: bang
105
- SASS
106
- foo bar
107
- baz bang {
108
- baz: bang; }
109
- SCSS
110
-
111
- assert_scss_to_scss <<SCSS
112
- foo bar
113
- baz bang {
114
- baz: bang; }
115
- SCSS
116
- end
117
-
118
- def test_escaped_selector
119
- assert_renders <<SASS, <<SCSS
120
- foo bar
121
- \\:hover
122
- baz: bang
123
- SASS
124
- foo bar {
125
- :hover {
126
- baz: bang; } }
127
- SCSS
128
- end
129
-
130
- def test_property_name_interpolation
131
- assert_renders <<SASS, <<SCSS
132
- foo bar
133
- baz\#{$bang}bip\#{$bop}: 12
134
- SASS
135
- foo bar {
136
- baz\#{$bang}bip\#{$bop}: 12; }
137
- SCSS
138
- end
139
-
140
- def test_property_name_interpolation
141
- assert_renders <<SASS, <<SCSS
142
- foo bar
143
- baz\#{$bang}bip\#{$bop}: 12
144
- SASS
145
- foo bar {
146
- baz\#{$bang}bip\#{$bop}: 12; }
147
- SCSS
148
- end
149
-
150
- def test_property_value_interpolation
151
- assert_renders <<SASS, <<SCSS
152
- foo bar
153
- baz: 12 \#{$bang} bip \#{"bop"} blat
154
- SASS
155
- foo bar {
156
- baz: 12 \#{$bang} bip \#{"bop"} blat; }
157
- SCSS
158
- end
159
-
160
- def test_dynamic_properties
161
- assert_renders <<SASS, <<SCSS
162
- foo bar
163
- baz: 12 $bang "bip"
164
- SASS
165
- foo bar {
166
- baz: 12 $bang "bip"; }
167
- SCSS
168
- end
169
-
170
- def test_dynamic_properties_with_old
171
- assert_renders <<SASS, <<SCSS, :old => true
172
- foo bar
173
- :baz 12 $bang "bip"
174
- SASS
175
- foo bar {
176
- baz: 12 $bang "bip"; }
177
- SCSS
178
- end
179
-
180
- def test_multiline_properties
181
- assert_scss_to_sass <<SASS, <<SCSS
182
- foo bar
183
- baz: bip bam boon
184
- SASS
185
- foo bar {
186
- baz:
187
- bip
188
- bam
189
- boon; }
190
- SCSS
191
-
192
- assert_scss_to_scss <<OUT, <<IN
193
- foo bar {
194
- baz: bip bam boon; }
195
- OUT
196
- foo bar {
197
- baz:
198
- bip
199
- bam
200
- boon; }
201
- IN
202
- end
203
-
204
- def test_multiline_dynamic_properties
205
- assert_scss_to_sass <<SASS, <<SCSS
206
- foo bar
207
- baz: $bip "bam" 12px
208
- SASS
209
- foo bar {
210
- baz:
211
- $bip
212
- "bam"
213
- 12px; }
214
- SCSS
215
-
216
- assert_scss_to_scss <<OUT, <<IN
217
- foo bar {
218
- baz: $bip "bam" 12px; }
219
- OUT
220
- foo bar {
221
- baz:
222
- $bip
223
- "bam"
224
- 12px; }
225
- IN
226
- end
227
-
228
- def test_silent_comments
229
- assert_renders <<SASS, <<SCSS
230
- // foo
231
-
232
- // bar
233
-
234
- // baz
235
-
236
- foo bar
237
- a: b
238
- SASS
239
- // foo
240
-
241
- // bar
242
-
243
- // baz
244
-
245
- foo bar {
246
- a: b; }
247
- SCSS
248
-
249
- assert_renders <<SASS, <<SCSS
250
- // foo
251
- // bar
252
- // baz
253
- // bang
254
-
255
- foo bar
256
- a: b
257
- SASS
258
- // foo
259
- // bar
260
- // baz
261
- // bang
262
-
263
- foo bar {
264
- a: b; }
265
- SCSS
266
-
267
- assert_sass_to_scss <<SCSS, <<SASS
268
- // foo
269
- // bar
270
- // baz
271
- // bang
272
-
273
- foo bar {
274
- a: b; }
275
- SCSS
276
- // foo
277
- // bar
278
- // baz
279
- // bang
280
-
281
- foo bar
282
- a: b
283
- SASS
284
- end
285
-
286
- def test_nested_silent_comments
287
- assert_renders <<SASS, <<SCSS
288
- foo
289
- bar: baz
290
- // bip bop
291
- // beep boop
292
- bang: bizz
293
- // bubble bubble
294
- // toil trouble
295
- SASS
296
- foo {
297
- bar: baz;
298
- // bip bop
299
- // beep boop
300
- bang: bizz;
301
- // bubble bubble
302
- // toil trouble
303
- }
304
- SCSS
305
-
306
- assert_sass_to_scss <<SCSS, <<SASS
307
- foo {
308
- bar: baz;
309
- // bip bop
310
- // beep boop
311
- // bap blimp
312
- bang: bizz;
313
- // bubble bubble
314
- // toil trouble
315
- // gorp
316
- }
317
- SCSS
318
- foo
319
- bar: baz
320
- // bip bop
321
- beep boop
322
- bap blimp
323
- bang: bizz
324
- // bubble bubble
325
- toil trouble
326
- gorp
327
- SASS
328
- end
329
-
330
- def test_loud_comments
331
- assert_renders <<SASS, <<SCSS
332
- /* foo
333
-
334
- /* bar
335
-
336
- /* baz
337
-
338
- foo bar
339
- a: b
340
- SASS
341
- /* foo */
342
-
343
- /* bar */
344
-
345
- /* baz */
346
-
347
- foo bar {
348
- a: b; }
349
- SCSS
350
-
351
- assert_scss_to_sass <<SASS, <<SCSS
352
- /* foo
353
- * bar
354
- * baz
355
- * bang
356
-
357
- foo bar
358
- a: b
359
- SASS
360
- /* foo
361
- bar
362
- baz
363
- bang */
364
-
365
- foo bar {
366
- a: b; }
367
- SCSS
368
-
369
- assert_scss_to_scss <<SCSS
370
- /* foo
371
- bar
372
- baz
373
- bang */
374
-
375
- foo bar {
376
- a: b; }
377
- SCSS
378
-
379
- assert_renders <<SASS, <<SCSS
380
- /* foo
381
- * bar
382
- * baz
383
- * bang
384
-
385
- foo bar
386
- a: b
387
- SASS
388
- /* foo
389
- * bar
390
- * baz
391
- * bang */
392
-
393
- foo bar {
394
- a: b; }
395
- SCSS
396
- end
397
-
398
- def test_nested_loud_comments
399
- assert_renders <<SASS, <<SCSS
400
- foo
401
- bar: baz
402
- /* bip bop
403
- * beep boop
404
- bang: bizz
405
- /* bubble bubble
406
- * toil trouble
407
- SASS
408
- foo {
409
- bar: baz;
410
- /* bip bop
411
- * beep boop */
412
- bang: bizz;
413
- /* bubble bubble
414
- * toil trouble */ }
415
- SCSS
416
-
417
- assert_sass_to_scss <<SCSS, <<SASS
418
- foo {
419
- bar: baz;
420
- /* bip bop
421
- * beep boop
422
- * bap blimp */
423
- bang: bizz;
424
- /* bubble bubble
425
- * toil trouble
426
- * gorp */ }
427
- SCSS
428
- foo
429
- bar: baz
430
- /* bip bop
431
- beep boop
432
- bap blimp
433
- bang: bizz
434
- /* bubble bubble
435
- toil trouble
436
- gorp
437
- SASS
438
- end
439
-
440
- def test_loud_comments_with_weird_indentation
441
- assert_scss_to_sass <<SASS, <<SCSS
442
- foo
443
- /* foo
444
- * bar
445
- * baz
446
- a: b
447
- SASS
448
- foo {
449
- /* foo
450
- bar
451
- baz */
452
- a: b; }
453
- SCSS
454
-
455
- assert_sass_to_scss <<SCSS, <<SASS
456
- foo {
457
- /* foo
458
- * bar
459
- * baz */
460
- a: b; }
461
- SCSS
462
- foo
463
- /* foo
464
- bar
465
- baz
466
- a: b
467
- SASS
468
- end
469
-
470
- def test_immediately_preceding_comments
471
- assert_renders <<SASS, <<SCSS
472
- /* Foo
473
- * Bar
474
- * Baz
475
- .foo#bar
476
- a: b
477
- SASS
478
- /* Foo
479
- * Bar
480
- * Baz */
481
- .foo#bar {
482
- a: b; }
483
- SCSS
484
-
485
- assert_renders <<SASS, <<SCSS
486
- // Foo
487
- // Bar
488
- // Baz
489
- =foo
490
- a: b
491
- SASS
492
- // Foo
493
- // Bar
494
- // Baz
495
- @mixin foo {
496
- a: b; }
497
- SCSS
498
- end
499
-
500
- def test_debug
501
- assert_renders <<SASS, <<SCSS
502
- foo
503
- @debug 12px
504
- bar: baz
505
- SASS
506
- foo {
507
- @debug 12px;
508
- bar: baz; }
509
- SCSS
510
- end
511
-
512
- def test_directive_without_children
513
- assert_renders <<SASS, <<SCSS
514
- foo
515
- @foo #bar "baz"
516
- bar: baz
517
- SASS
518
- foo {
519
- @foo #bar "baz";
520
- bar: baz; }
521
- SCSS
522
- end
523
-
524
- def test_directive_with_prop_children
525
- assert_renders <<SASS, <<SCSS
526
- foo
527
- @foo #bar "baz"
528
- a: b
529
- c: d
530
-
531
- bar: baz
532
- SASS
533
- foo {
534
- @foo #bar "baz" {
535
- a: b;
536
- c: d; }
537
-
538
- bar: baz; }
539
- SCSS
540
- end
541
-
542
- def test_directive_with_rule_children
543
- assert_renders <<SASS, <<SCSS
544
- foo
545
- @foo #bar "baz"
546
- #blat
547
- a: b
548
- .bang
549
- c: d
550
- e: f
551
-
552
- bar: baz
553
- SASS
554
- foo {
555
- @foo #bar "baz" {
556
- #blat {
557
- a: b; }
558
- .bang {
559
- c: d;
560
- e: f; } }
561
-
562
- bar: baz; }
563
- SCSS
564
- end
565
-
566
- def test_directive_with_rule_and_prop_children
567
- assert_renders <<SASS, <<SCSS
568
- foo
569
- @foo #bar "baz"
570
- g: h
571
- #blat
572
- a: b
573
- .bang
574
- c: d
575
- e: f
576
- i: j
577
-
578
- bar: baz
579
- SASS
580
- foo {
581
- @foo #bar "baz" {
582
- g: h;
583
- #blat {
584
- a: b; }
585
- .bang {
586
- c: d;
587
- e: f; }
588
- i: j; }
589
-
590
- bar: baz; }
591
- SCSS
592
- end
593
-
594
- def test_charset
595
- assert_renders <<SASS, <<SCSS
596
- @charset "utf-8"
597
- SASS
598
- @charset "utf-8";
599
- SCSS
600
- end
601
-
602
- def test_for
603
- assert_renders <<SASS, <<SCSS
604
- foo
605
- @for $a from $b to $c
606
- a: b
607
- @for $c from 1 to 16
608
- d: e
609
- f: g
610
- SASS
611
- foo {
612
- @for $a from $b to $c {
613
- a: b; }
614
- @for $c from 1 to 16 {
615
- d: e;
616
- f: g; } }
617
- SCSS
618
- end
619
-
620
- def test_while
621
- assert_renders <<SASS, <<SCSS
622
- foo
623
- @while flaz($a + $b)
624
- a: b
625
- @while 1
626
- d: e
627
- f: g
628
- SASS
629
- foo {
630
- @while flaz($a + $b) {
631
- a: b; }
632
- @while 1 {
633
- d: e;
634
- f: g; } }
635
- SCSS
636
- end
637
-
638
- def test_if
639
- assert_renders <<SASS, <<SCSS
640
- foo
641
- @if $foo or $bar
642
- a: b
643
- @if $baz
644
- d: e
645
- @else if $bang
646
- f: g
647
- @else
648
- h: i
649
- SASS
650
- foo {
651
- @if $foo or $bar {
652
- a: b; }
653
- @if $baz {
654
- d: e; }
655
- @else if $bang {
656
- f: g; }
657
- @else {
658
- h: i; } }
659
- SCSS
660
- end
661
-
662
- def test_each
663
- assert_renders <<SASS, <<SCSS
664
- a
665
- @each $number in 1px 2px 3px 4px
666
- b: $number
667
-
668
- c
669
- @each $str in foo, bar, baz, bang
670
- d: $str
671
- SASS
672
- a {
673
- @each $number in 1px 2px 3px 4px {
674
- b: $number; } }
675
-
676
- c {
677
- @each $str in foo, bar, baz, bang {
678
- d: $str; } }
679
- SCSS
680
- end
681
-
682
- def test_import
683
- assert_renders <<SASS, <<SCSS
684
- @import foo
685
-
686
- @import url(bar.css)
687
-
688
- foo
689
- bar: baz
690
- SASS
691
- @import "foo";
692
-
693
- @import url(bar.css);
694
-
695
- foo {
696
- bar: baz; }
697
- SCSS
698
-
699
- assert_renders <<SASS, <<SCSS
700
- @import foo.css
701
-
702
- @import url(bar.css)
703
-
704
- foo
705
- bar: baz
706
- SASS
707
- @import "foo.css";
708
-
709
- @import url(bar.css);
710
-
711
- foo {
712
- bar: baz; }
713
- SCSS
714
- end
715
-
716
- def test_import_as_directive_in_sass
717
- assert_equal "@import foo.css\n", to_sass('@import "foo.css"')
718
- end
719
-
720
- def test_import_as_directive_in_scss
721
- assert_renders <<SASS, <<SCSS
722
- @import "foo.css" print
723
- SASS
724
- @import "foo.css" print;
725
- SCSS
726
-
727
- assert_renders <<SASS, <<SCSS
728
- @import url(foo.css) screen, print
729
- SASS
730
- @import url(foo.css) screen, print;
731
- SCSS
732
- end
733
-
734
- def test_adjacent_imports
735
- assert_renders <<SASS, <<SCSS
736
- @import foo.sass
737
- @import bar.scss
738
- @import baz
739
- SASS
740
- @import "foo.sass";
741
- @import "bar.scss";
742
- @import "baz";
743
- SCSS
744
- end
745
-
746
- def test_non_adjacent_imports
747
- assert_renders <<SASS, <<SCSS
748
- @import foo.sass
749
-
750
- @import bar.scss
751
-
752
- @import baz
753
- SASS
754
- @import "foo.sass";
755
-
756
- @import "bar.scss";
757
-
758
- @import "baz";
759
- SCSS
760
- end
761
-
762
- def test_extend
763
- assert_renders <<SASS, <<SCSS
764
- .foo
765
- @extend .bar
766
- @extend .baz:bang
767
- SASS
768
- .foo {
769
- @extend .bar;
770
- @extend .baz:bang; }
771
- SCSS
772
- end
773
-
774
- def test_argless_mixin_definition
775
- assert_renders <<SASS, <<SCSS
776
- =foo-bar
777
- baz
778
- a: b
779
- SASS
780
- @mixin foo-bar {
781
- baz {
782
- a: b; } }
783
- SCSS
784
-
785
- assert_scss_to_sass <<SASS, <<SCSS
786
- =foo-bar
787
- baz
788
- a: b
789
- SASS
790
- @mixin foo-bar() {
791
- baz {
792
- a: b; } }
793
- SCSS
794
-
795
- assert_sass_to_scss <<SCSS, <<SASS
796
- @mixin foo-bar {
797
- baz {
798
- a: b; } }
799
- SCSS
800
- =foo-bar()
801
- baz
802
- a: b
803
- SASS
804
- end
805
-
806
- def test_mixin_definition_without_defaults
807
- assert_renders <<SASS, <<SCSS
808
- =foo-bar($baz, $bang)
809
- baz
810
- a: $baz $bang
811
- SASS
812
- @mixin foo-bar($baz, $bang) {
813
- baz {
814
- a: $baz $bang; } }
815
- SCSS
816
- end
817
-
818
- def test_mixin_definition_with_defaults
819
- assert_renders <<SASS, <<SCSS
820
- =foo-bar($baz, $bang: 12px)
821
- baz
822
- a: $baz $bang
823
- SASS
824
- @mixin foo-bar($baz, $bang: 12px) {
825
- baz {
826
- a: $baz $bang; } }
827
- SCSS
828
-
829
- assert_sass_to_scss <<SCSS, <<SASS
830
- @mixin foo-bar($baz, $bang: foo) {
831
- baz {
832
- a: $baz $bang; } }
833
- SCSS
834
- =foo-bar($baz, $bang: foo)
835
- baz
836
- a: $baz $bang
837
- SASS
838
- end
839
-
840
- def test_argless_mixin_include
841
- assert_renders <<SASS, <<SCSS
842
- foo
843
- +foo-bar
844
- a: blip
845
- SASS
846
- foo {
847
- @include foo-bar;
848
- a: blip; }
849
- SCSS
850
- end
851
-
852
- def test_mixin_include
853
- assert_renders <<SASS, <<SCSS
854
- foo
855
- +foo-bar(12px, "blaz")
856
- a: blip
857
- SASS
858
- foo {
859
- @include foo-bar(12px, "blaz");
860
- a: blip; }
861
- SCSS
862
- end
863
-
864
- def test_mixin_include_with_keyword_args
865
- assert_renders <<SASS, <<SCSS
866
- foo
867
- +foo-bar(12px, "blaz", $blip: blap, $bloop: blop)
868
- +foo-bar($blip: blap, $bloop: blop)
869
- a: blip
870
- SASS
871
- foo {
872
- @include foo-bar(12px, "blaz", $blip: blap, $bloop: blop);
873
- @include foo-bar($blip: blap, $bloop: blop);
874
- a: blip; }
875
- SCSS
876
- end
877
-
878
- def test_argless_function_definition
879
- assert_renders <<SASS, <<SCSS
880
- @function foo()
881
- $var: 1 + 1
882
- @return $var
883
- SASS
884
- @function foo() {
885
- $var: 1 + 1;
886
- @return $var; }
887
- SCSS
888
- end
889
-
890
- def test_function_definition_without_defaults
891
- assert_renders <<SASS, <<SCSS
892
- @function foo($var1, $var2)
893
- @if $var1
894
- @return $var1 + $var2
895
- SASS
896
- @function foo($var1, $var2) {
897
- @if $var1 {
898
- @return $var1 + $var2; } }
899
- SCSS
900
- end
901
-
902
- def test_function_definition_with_defaults
903
- assert_renders <<SASS, <<SCSS
904
- @function foo($var1, $var2: foo)
905
- @if $var1
906
- @return $var1 + $var2
907
- SASS
908
- @function foo($var1, $var2: foo) {
909
- @if $var1 {
910
- @return $var1 + $var2; } }
911
- SCSS
912
- end
913
-
914
- def test_variable_definition
915
- assert_renders <<SASS, <<SCSS
916
- $var1: 12px + 15px
917
-
918
- foo
919
- $var2: flaz(#abcdef)
920
- val: $var1 $var2
921
- SASS
922
- $var1: 12px + 15px;
923
-
924
- foo {
925
- $var2: flaz(#abcdef);
926
- val: $var1 $var2; }
927
- SCSS
928
- end
929
-
930
- def test_guarded_variable_definition
931
- assert_renders <<SASS, <<SCSS
932
- $var1: 12px + 15px !default
933
-
934
- foo
935
- $var2: flaz(#abcdef) !default
936
- val: $var1 $var2
937
- SASS
938
- $var1: 12px + 15px !default;
939
-
940
- foo {
941
- $var2: flaz(#abcdef) !default;
942
- val: $var1 $var2; }
943
- SCSS
944
- end
945
-
946
- def test_multiple_variable_definitions
947
- assert_renders <<SASS, <<SCSS
948
- $var1: foo
949
- $var2: bar
950
- $var3: baz
951
-
952
- $var4: bip
953
- $var5: bap
954
- SASS
955
- $var1: foo;
956
- $var2: bar;
957
- $var3: baz;
958
-
959
- $var4: bip;
960
- $var5: bap;
961
- SCSS
962
- end
963
-
964
- def test_division_asserted_with_parens
965
- assert_renders <<SASS, <<SCSS
966
- foo
967
- a: (1px / 2px)
968
- SASS
969
- foo {
970
- a: (1px / 2px); }
971
- SCSS
972
- end
973
-
974
- def test_division_not_asserted_when_unnecessary
975
- assert_renders <<SASS, <<SCSS
976
- $var: 1px / 2px
977
-
978
- foo
979
- a: $var
980
- SASS
981
- $var: 1px / 2px;
982
-
983
- foo {
984
- a: $var; }
985
- SCSS
986
-
987
- assert_renders <<SASS, <<SCSS
988
- $var: 1px
989
-
990
- foo
991
- a: $var / 2px
992
- SASS
993
- $var: 1px;
994
-
995
- foo {
996
- a: $var / 2px; }
997
- SCSS
998
-
999
- assert_renders <<SASS, <<SCSS
1000
- foo
1001
- a: 1 + 1px / 2px
1002
- SASS
1003
- foo {
1004
- a: 1 + 1px / 2px; }
1005
- SCSS
1006
- end
1007
-
1008
- def test_literal_slash
1009
- assert_renders <<SASS, <<SCSS
1010
- foo
1011
- a: 1px / 2px
1012
- SASS
1013
- foo {
1014
- a: 1px / 2px; }
1015
- SCSS
1016
- end
1017
-
1018
- # Hacks
1019
-
1020
- def test_declaration_hacks
1021
- assert_renders <<SASS, <<SCSS
1022
- foo
1023
- _name: val
1024
- *name: val
1025
- #name: val
1026
- .name: val
1027
- name/**/: val
1028
- name/*\\**/: val
1029
- name: val
1030
- SASS
1031
- foo {
1032
- _name: val;
1033
- *name: val;
1034
- #name: val;
1035
- .name: val;
1036
- name/**/: val;
1037
- name/*\\**/: val;
1038
- name: val; }
1039
- SCSS
1040
- end
1041
-
1042
- def test_old_declaration_hacks
1043
- assert_renders <<SASS, <<SCSS, :old => true
1044
- foo
1045
- :_name val
1046
- :*name val
1047
- :#name val
1048
- :.name val
1049
- :name val
1050
- SASS
1051
- foo {
1052
- _name: val;
1053
- *name: val;
1054
- #name: val;
1055
- .name: val;
1056
- name: val; }
1057
- SCSS
1058
- end
1059
-
1060
- def test_selector_hacks
1061
- assert_selector_renders = lambda do |s|
1062
- assert_renders <<SASS, <<SCSS
1063
- #{s}
1064
- a: b
1065
- SASS
1066
- #{s} {
1067
- a: b; }
1068
- SCSS
1069
- end
1070
-
1071
- assert_selector_renders['> E']
1072
- assert_selector_renders['+ E']
1073
- assert_selector_renders['~ E']
1074
- assert_selector_renders['> > E']
1075
-
1076
- assert_selector_renders['E*']
1077
- assert_selector_renders['E*.foo']
1078
- assert_selector_renders['E*:hover']
1079
- end
1080
-
1081
- def test_disallowed_colon_hack
1082
- assert_raise_message(Sass::SyntaxError, 'The ":name: val" hack is not allowed in the Sass indented syntax') do
1083
- to_sass("foo {:name: val;}", :syntax => :scss)
1084
- end
1085
- end
1086
-
1087
- def test_nested_properties
1088
- assert_renders <<SASS, <<SCSS
1089
- div
1090
- before: before
1091
- background:
1092
- color: blue
1093
- repeat: no-repeat
1094
- after: after
1095
- SASS
1096
- div {
1097
- before: before;
1098
- background: {
1099
- color: blue;
1100
- repeat: no-repeat; };
1101
- after: after; }
1102
-
1103
- SCSS
1104
- end
1105
-
1106
- def test_dasherize
1107
- assert_sass_to_scss(<<SCSS, <<SASS, :dasherize => true)
1108
- @mixin under-scored-mixin($under-scored-arg: $under-scored-default) {
1109
- bar: $under-scored-arg; }
1110
-
1111
- div {
1112
- foo: under-scored-fn($under-scored-var + "before\#{$another-under-scored-var}after");
1113
- @include under-scored-mixin($passed-arg);
1114
- selector-\#{$under-scored-interp}: bold; }
1115
-
1116
- @if $under-scored {
1117
- @for $for-var from $from-var to $to-var {
1118
- @while $while-var == true {
1119
- $while-var: false; } } }
1120
- SCSS
1121
- =under_scored_mixin($under_scored_arg: $under_scored_default)
1122
- bar: $under_scored_arg
1123
- div
1124
- foo: under_scored_fn($under_scored_var + "before\#{$another_under_scored_var}after")
1125
- +under_scored_mixin($passed_arg)
1126
- selector-\#{$under_scored_interp}: bold
1127
- @if $under_scored
1128
- @for $for_var from $from_var to $to_var
1129
- @while $while_var == true
1130
- $while_var : false
1131
- SASS
1132
- end
1133
-
1134
- def test_loud_comment_conversion
1135
- assert_renders(<<SASS, <<SCSS)
1136
- /*! \#{"interpolated"}
1137
- SASS
1138
- /*! \#{"interpolated"} */
1139
- SCSS
1140
- silence_warnings {assert_renders(<<SASS, <<SCSS)}
1141
- //! \#{"interpolated"}
1142
- //!
1143
- //! \#{"also interpolated"}
1144
- SASS
1145
- //! \#{"interpolated"}
1146
- //!
1147
- //! \#{"also interpolated"}
1148
- SCSS
1149
- end
1150
-
1151
- private
1152
-
1153
- def assert_sass_to_sass(sass, options = {})
1154
- assert_equal(sass.rstrip, to_sass(sass, options).rstrip,
1155
- "Expected Sass to transform to itself")
1156
- end
1157
-
1158
- def assert_scss_to_sass(sass, scss, options = {})
1159
- assert_equal(sass.rstrip, to_sass(scss, options.merge(:syntax => :scss)).rstrip,
1160
- "Expected SCSS to transform to Sass")
1161
- end
1162
-
1163
- def assert_scss_to_scss(scss, in_scss = nil, options = nil)
1164
- if in_scss.is_a?(Hash)
1165
- options = in_scss
1166
- in_scss = nil
1167
- end
1168
-
1169
- in_scss ||= scss
1170
- options ||= {}
1171
-
1172
- assert_equal(scss.rstrip, to_scss(in_scss, options.merge(:syntax => :scss)).rstrip,
1173
- "Expected SCSS to transform to #{scss == in_scss ? 'itself' : 'SCSS'}k")
1174
- end
1175
-
1176
- def assert_sass_to_scss(scss, sass, options = {})
1177
- assert_equal(scss.rstrip, to_scss(sass, options).rstrip,
1178
- "Expected Sass to transform to SCSS")
1179
- end
1180
-
1181
- def assert_renders(sass, scss, options = {})
1182
- assert_sass_to_sass(sass, options)
1183
- assert_scss_to_sass(sass, scss, options)
1184
- assert_scss_to_scss(scss, options)
1185
- assert_sass_to_scss(scss, sass, options)
1186
- end
1187
-
1188
- def to_sass(scss, options = {})
1189
- Sass::Util.silence_sass_warnings do
1190
- Sass::Engine.new(scss, options).to_tree.to_sass(options)
1191
- end
1192
- end
1193
-
1194
- def to_scss(sass, options = {})
1195
- Sass::Util.silence_sass_warnings do
1196
- Sass::Engine.new(sass, options).to_tree.to_scss(options)
1197
- end
1198
- end
1199
- end