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,1348 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../test_helper'
3
-
4
- class ExtendTest < Test::Unit::TestCase
5
- def test_basic
6
- assert_equal <<CSS, render(<<SCSS)
7
- .foo, .bar {
8
- a: b; }
9
- CSS
10
- .foo {a: b}
11
- .bar {@extend .foo}
12
- SCSS
13
-
14
- assert_equal <<CSS, render(<<SCSS)
15
- .foo, .bar {
16
- a: b; }
17
- CSS
18
- .bar {@extend .foo}
19
- .foo {a: b}
20
- SCSS
21
-
22
- assert_equal <<CSS, render(<<SCSS)
23
- .foo, .bar {
24
- a: b; }
25
-
26
- .bar {
27
- c: d; }
28
- CSS
29
- .foo {a: b}
30
- .bar {c: d; @extend .foo}
31
- SCSS
32
-
33
- assert_equal <<CSS, render(<<SCSS)
34
- .foo, .bar {
35
- a: b; }
36
-
37
- .bar {
38
- c: d; }
39
- CSS
40
- .foo {a: b}
41
- .bar {@extend .foo; c: d}
42
- SCSS
43
- end
44
-
45
- def test_indented_syntax
46
- assert_equal <<CSS, render(<<SASS, :syntax => :sass)
47
- .foo, .bar {
48
- a: b; }
49
- CSS
50
- .foo
51
- a: b
52
- .bar
53
- @extend .foo
54
- SASS
55
-
56
- assert_equal <<CSS, render(<<SASS, :syntax => :sass)
57
- .foo, .bar {
58
- a: b; }
59
- CSS
60
- .foo
61
- a: b
62
- .bar
63
- @extend \#{".foo"}
64
- SASS
65
- end
66
-
67
- def test_multiple_targets
68
- assert_equal <<CSS, render(<<SCSS)
69
- .foo, .bar {
70
- a: b; }
71
-
72
- .blip .foo, .blip .bar {
73
- c: d; }
74
- CSS
75
- .foo {a: b}
76
- .bar {@extend .foo}
77
- .blip .foo {c: d}
78
- SCSS
79
- end
80
-
81
- def test_multiple_extendees
82
- assert_equal <<CSS, render(<<SCSS)
83
- .foo, .baz {
84
- a: b; }
85
-
86
- .bar, .baz {
87
- c: d; }
88
- CSS
89
- .foo {a: b}
90
- .bar {c: d}
91
- .baz {@extend .foo; @extend .bar}
92
- SCSS
93
- end
94
-
95
- def test_multiple_extends_with_single_extender_and_single_target
96
- assert_equal <<CSS, render(<<SCSS)
97
- .foo .bar, .baz .bar, .foo .baz, .baz .baz {
98
- a: b; }
99
- CSS
100
- .foo .bar {a: b}
101
- .baz {@extend .foo; @extend .bar}
102
- SCSS
103
-
104
- assert_equal <<CSS, render(<<SCSS)
105
- .foo.bar, .baz {
106
- a: b; }
107
- CSS
108
- .foo.bar {a: b}
109
- .baz {@extend .foo; @extend .bar}
110
- SCSS
111
- end
112
-
113
- def test_multiple_extends_with_multiple_extenders_and_single_target
114
- assert_equal <<CSS, render(<<SCSS)
115
- .foo .bar, .baz .bar, .foo .bang, .baz .bang {
116
- a: b; }
117
- CSS
118
- .foo .bar {a: b}
119
- .baz {@extend .foo}
120
- .bang {@extend .bar}
121
- SCSS
122
-
123
- assert_equal <<CSS, render(<<SCSS)
124
- .foo.bar, .bar.baz, .baz.bang, .foo.bang {
125
- a: b; }
126
- CSS
127
- .foo.bar {a: b}
128
- .baz {@extend .foo}
129
- .bang {@extend .bar}
130
- SCSS
131
- end
132
-
133
- def test_chained_extends
134
- assert_equal <<CSS, render(<<SCSS)
135
- .foo, .bar, .baz, .bip {
136
- a: b; }
137
- CSS
138
- .foo {a: b}
139
- .bar {@extend .foo}
140
- .baz {@extend .bar}
141
- .bip {@extend .bar}
142
- SCSS
143
- end
144
-
145
- def test_dynamic_extendee
146
- assert_equal <<CSS, render(<<SCSS)
147
- .foo, .bar {
148
- a: b; }
149
- CSS
150
- .foo {a: b}
151
- .bar {@extend \#{".foo"}}
152
- SCSS
153
-
154
- assert_equal <<CSS, render(<<SCSS)
155
- [baz^="blip12px"], .bar {
156
- a: b; }
157
- CSS
158
- [baz^="blip12px"] {a: b}
159
- .bar {@extend [baz^="blip\#{12px}"]}
160
- SCSS
161
- end
162
-
163
- def test_nested_target
164
- assert_equal <<CSS, render(<<SCSS)
165
- .foo .bar, .foo .baz {
166
- a: b; }
167
- CSS
168
- .foo .bar {a: b}
169
- .baz {@extend .bar}
170
- SCSS
171
- end
172
-
173
- def test_target_with_child
174
- assert_equal <<CSS, render(<<SCSS)
175
- .foo .bar, .baz .bar {
176
- a: b; }
177
- CSS
178
- .foo .bar {a: b}
179
- .baz {@extend .foo}
180
- SCSS
181
- end
182
-
183
- def test_class_unification
184
- assert_equal <<CSS, render(<<SCSS)
185
- .foo.bar, .bar.baz {
186
- a: b; }
187
- CSS
188
- .foo.bar {a: b}
189
- .baz {@extend .foo}
190
- SCSS
191
-
192
- assert_equal <<CSS, render(<<SCSS)
193
- .baz {
194
- a: b; }
195
- CSS
196
- .foo.baz {a: b}
197
- .baz {@extend .foo}
198
- SCSS
199
- end
200
-
201
- def test_id_unification
202
- assert_equal <<CSS, render(<<SCSS)
203
- .foo.bar, .bar#baz {
204
- a: b; }
205
- CSS
206
- .foo.bar {a: b}
207
- #baz {@extend .foo}
208
- SCSS
209
-
210
- assert_equal <<CSS, render(<<SCSS)
211
- #baz {
212
- a: b; }
213
- CSS
214
- .foo#baz {a: b}
215
- #baz {@extend .foo}
216
- SCSS
217
-
218
- assert_equal <<CSS, render(<<SCSS)
219
- .foo#baz {
220
- a: b; }
221
- CSS
222
- .foo#baz {a: b}
223
- #bar {@extend .foo}
224
- SCSS
225
- end
226
-
227
- def test_universal_unification_with_simple_target
228
- assert_equal <<CSS, render(<<SCSS)
229
- .foo, * {
230
- a: b; }
231
- CSS
232
- .foo {a: b}
233
- * {@extend .foo}
234
- SCSS
235
-
236
- assert_equal <<CSS, render(<<SCSS)
237
- .foo, *|* {
238
- a: b; }
239
- CSS
240
- .foo {a: b}
241
- *|* {@extend .foo}
242
- SCSS
243
-
244
- assert_equal <<CSS, render(<<SCSS)
245
- .bar {
246
- a: b; }
247
- CSS
248
- .foo.bar {a: b}
249
- * {@extend .foo}
250
- SCSS
251
-
252
- assert_equal <<CSS, render(<<SCSS)
253
- .bar {
254
- a: b; }
255
- CSS
256
- .foo.bar {a: b}
257
- *|* {@extend .foo}
258
- SCSS
259
-
260
- assert_equal <<CSS, render(<<SCSS)
261
- .foo.bar, ns|*.bar {
262
- a: b; }
263
- CSS
264
- .foo.bar {a: b}
265
- ns|* {@extend .foo}
266
- SCSS
267
- end
268
-
269
- def test_universal_unification_with_namespaceless_universal_target
270
- assert_equal <<CSS, render(<<SCSS)
271
- * {
272
- a: b; }
273
- CSS
274
- *.foo {a: b}
275
- * {@extend .foo}
276
- SCSS
277
-
278
- assert_equal <<CSS, render(<<SCSS)
279
- * {
280
- a: b; }
281
- CSS
282
- *.foo {a: b}
283
- *|* {@extend .foo}
284
- SCSS
285
-
286
- assert_equal <<CSS, render(<<SCSS)
287
- *|*.foo, * {
288
- a: b; }
289
- CSS
290
- *|*.foo {a: b}
291
- * {@extend .foo}
292
- SCSS
293
-
294
- assert_equal <<CSS, render(<<SCSS)
295
- *|* {
296
- a: b; }
297
- CSS
298
- *|*.foo {a: b}
299
- *|* {@extend .foo}
300
- SCSS
301
-
302
- assert_equal <<CSS, render(<<SCSS)
303
- *.foo, ns|* {
304
- a: b; }
305
- CSS
306
- *.foo {a: b}
307
- ns|* {@extend .foo}
308
- SCSS
309
-
310
- assert_equal <<CSS, render(<<SCSS)
311
- *|*.foo, ns|* {
312
- a: b; }
313
- CSS
314
- *|*.foo {a: b}
315
- ns|* {@extend .foo}
316
- SCSS
317
- end
318
-
319
- def test_universal_unification_with_namespaced_universal_target
320
- assert_equal <<CSS, render(<<SCSS)
321
- ns|* {
322
- a: b; }
323
- CSS
324
- ns|*.foo {a: b}
325
- * {@extend .foo}
326
- SCSS
327
-
328
- assert_equal <<CSS, render(<<SCSS)
329
- ns|* {
330
- a: b; }
331
- CSS
332
- ns|*.foo {a: b}
333
- *|* {@extend .foo}
334
- SCSS
335
-
336
- assert_equal <<CSS, render(<<SCSS)
337
- ns1|*.foo {
338
- a: b; }
339
- CSS
340
- ns1|*.foo {a: b}
341
- ns2|* {@extend .foo}
342
- SCSS
343
-
344
- assert_equal <<CSS, render(<<SCSS)
345
- ns|* {
346
- a: b; }
347
- CSS
348
- ns|*.foo {a: b}
349
- ns|* {@extend .foo}
350
- SCSS
351
- end
352
-
353
- def test_universal_unification_with_namespaceless_element_target
354
- assert_equal <<CSS, render(<<SCSS)
355
- a {
356
- a: b; }
357
- CSS
358
- a.foo {a: b}
359
- * {@extend .foo}
360
- SCSS
361
-
362
- assert_equal <<CSS, render(<<SCSS)
363
- a {
364
- a: b; }
365
- CSS
366
- a.foo {a: b}
367
- *|* {@extend .foo}
368
- SCSS
369
-
370
- assert_equal <<CSS, render(<<SCSS)
371
- *|a.foo, a {
372
- a: b; }
373
- CSS
374
- *|a.foo {a: b}
375
- * {@extend .foo}
376
- SCSS
377
-
378
- assert_equal <<CSS, render(<<SCSS)
379
- *|a {
380
- a: b; }
381
- CSS
382
- *|a.foo {a: b}
383
- *|* {@extend .foo}
384
- SCSS
385
-
386
- assert_equal <<CSS, render(<<SCSS)
387
- a.foo, ns|a {
388
- a: b; }
389
- CSS
390
- a.foo {a: b}
391
- ns|* {@extend .foo}
392
- SCSS
393
-
394
- assert_equal <<CSS, render(<<SCSS)
395
- *|a.foo, ns|a {
396
- a: b; }
397
- CSS
398
- *|a.foo {a: b}
399
- ns|* {@extend .foo}
400
- SCSS
401
- end
402
-
403
- def test_universal_unification_with_namespaced_element_target
404
- assert_equal <<CSS, render(<<SCSS)
405
- ns|a {
406
- a: b; }
407
- CSS
408
- ns|a.foo {a: b}
409
- * {@extend .foo}
410
- SCSS
411
-
412
- assert_equal <<CSS, render(<<SCSS)
413
- ns|a {
414
- a: b; }
415
- CSS
416
- ns|a.foo {a: b}
417
- *|* {@extend .foo}
418
- SCSS
419
-
420
- assert_equal <<CSS, render(<<SCSS)
421
- ns1|a.foo {
422
- a: b; }
423
- CSS
424
- ns1|a.foo {a: b}
425
- ns2|* {@extend .foo}
426
- SCSS
427
-
428
- assert_equal <<CSS, render(<<SCSS)
429
- ns|a {
430
- a: b; }
431
- CSS
432
- ns|a.foo {a: b}
433
- ns|* {@extend .foo}
434
- SCSS
435
- end
436
-
437
- def test_element_unification_with_simple_target
438
- assert_equal <<CSS, render(<<SCSS)
439
- .foo, a {
440
- a: b; }
441
- CSS
442
- .foo {a: b}
443
- a {@extend .foo}
444
- SCSS
445
-
446
- assert_equal <<CSS, render(<<SCSS)
447
- .foo.bar, a.bar {
448
- a: b; }
449
- CSS
450
- .foo.bar {a: b}
451
- a {@extend .foo}
452
- SCSS
453
-
454
- assert_equal <<CSS, render(<<SCSS)
455
- .foo.bar, *|a.bar {
456
- a: b; }
457
- CSS
458
- .foo.bar {a: b}
459
- *|a {@extend .foo}
460
- SCSS
461
-
462
- assert_equal <<CSS, render(<<SCSS)
463
- .foo.bar, ns|a.bar {
464
- a: b; }
465
- CSS
466
- .foo.bar {a: b}
467
- ns|a {@extend .foo}
468
- SCSS
469
- end
470
-
471
- def test_element_unification_with_namespaceless_universal_target
472
- assert_equal <<CSS, render(<<SCSS)
473
- *.foo, a {
474
- a: b; }
475
- CSS
476
- *.foo {a: b}
477
- a {@extend .foo}
478
- SCSS
479
-
480
- assert_equal <<CSS, render(<<SCSS)
481
- *.foo, a {
482
- a: b; }
483
- CSS
484
- *.foo {a: b}
485
- *|a {@extend .foo}
486
- SCSS
487
-
488
- assert_equal <<CSS, render(<<SCSS)
489
- *|*.foo, a {
490
- a: b; }
491
- CSS
492
- *|*.foo {a: b}
493
- a {@extend .foo}
494
- SCSS
495
-
496
- assert_equal <<CSS, render(<<SCSS)
497
- *|*.foo, *|a {
498
- a: b; }
499
- CSS
500
- *|*.foo {a: b}
501
- *|a {@extend .foo}
502
- SCSS
503
-
504
- assert_equal <<CSS, render(<<SCSS)
505
- *.foo, ns|a {
506
- a: b; }
507
- CSS
508
- *.foo {a: b}
509
- ns|a {@extend .foo}
510
- SCSS
511
-
512
- assert_equal <<CSS, render(<<SCSS)
513
- *|*.foo, ns|a {
514
- a: b; }
515
- CSS
516
- *|*.foo {a: b}
517
- ns|a {@extend .foo}
518
- SCSS
519
- end
520
-
521
- def test_element_unification_with_namespaced_universal_target
522
- assert_equal <<CSS, render(<<SCSS)
523
- ns|*.foo, ns|a {
524
- a: b; }
525
- CSS
526
- ns|*.foo {a: b}
527
- a {@extend .foo}
528
- SCSS
529
-
530
- assert_equal <<CSS, render(<<SCSS)
531
- ns|*.foo, ns|a {
532
- a: b; }
533
- CSS
534
- ns|*.foo {a: b}
535
- *|a {@extend .foo}
536
- SCSS
537
-
538
- assert_equal <<CSS, render(<<SCSS)
539
- ns1|*.foo {
540
- a: b; }
541
- CSS
542
- ns1|*.foo {a: b}
543
- ns2|a {@extend .foo}
544
- SCSS
545
-
546
- assert_equal <<CSS, render(<<SCSS)
547
- ns|*.foo, ns|a {
548
- a: b; }
549
- CSS
550
- ns|*.foo {a: b}
551
- ns|a {@extend .foo}
552
- SCSS
553
- end
554
-
555
- def test_element_unification_with_namespaceless_element_target
556
- assert_equal <<CSS, render(<<SCSS)
557
- a {
558
- a: b; }
559
- CSS
560
- a.foo {a: b}
561
- a {@extend .foo}
562
- SCSS
563
-
564
- assert_equal <<CSS, render(<<SCSS)
565
- a {
566
- a: b; }
567
- CSS
568
- a.foo {a: b}
569
- *|a {@extend .foo}
570
- SCSS
571
-
572
- assert_equal <<CSS, render(<<SCSS)
573
- *|a.foo, a {
574
- a: b; }
575
- CSS
576
- *|a.foo {a: b}
577
- a {@extend .foo}
578
- SCSS
579
-
580
- assert_equal <<CSS, render(<<SCSS)
581
- *|a {
582
- a: b; }
583
- CSS
584
- *|a.foo {a: b}
585
- *|a {@extend .foo}
586
- SCSS
587
-
588
- assert_equal <<CSS, render(<<SCSS)
589
- a.foo, ns|a {
590
- a: b; }
591
- CSS
592
- a.foo {a: b}
593
- ns|a {@extend .foo}
594
- SCSS
595
-
596
- assert_equal <<CSS, render(<<SCSS)
597
- *|a.foo, ns|a {
598
- a: b; }
599
- CSS
600
- *|a.foo {a: b}
601
- ns|a {@extend .foo}
602
- SCSS
603
-
604
- assert_equal <<CSS, render(<<SCSS)
605
- a.foo {
606
- a: b; }
607
- CSS
608
- a.foo {a: b}
609
- h1 {@extend .foo}
610
- SCSS
611
- end
612
-
613
- def test_element_unification_with_namespaced_element_target
614
- assert_equal <<CSS, render(<<SCSS)
615
- ns|a {
616
- a: b; }
617
- CSS
618
- ns|a.foo {a: b}
619
- a {@extend .foo}
620
- SCSS
621
-
622
- assert_equal <<CSS, render(<<SCSS)
623
- ns|a {
624
- a: b; }
625
- CSS
626
- ns|a.foo {a: b}
627
- *|a {@extend .foo}
628
- SCSS
629
-
630
- assert_equal <<CSS, render(<<SCSS)
631
- ns1|a.foo {
632
- a: b; }
633
- CSS
634
- ns1|a.foo {a: b}
635
- ns2|a {@extend .foo}
636
- SCSS
637
-
638
- assert_equal <<CSS, render(<<SCSS)
639
- ns|a {
640
- a: b; }
641
- CSS
642
- ns|a.foo {a: b}
643
- ns|a {@extend .foo}
644
- SCSS
645
- end
646
-
647
- def test_attribute_unification
648
- assert_equal <<CSS, render(<<SCSS)
649
- [foo=bar].baz, [foo=bar][foo=baz] {
650
- a: b; }
651
- CSS
652
- [foo=bar].baz {a: b}
653
- [foo=baz] {@extend .baz}
654
- SCSS
655
-
656
- assert_equal <<CSS, render(<<SCSS)
657
- [foo=bar].baz, [foo=bar][foo^=bar] {
658
- a: b; }
659
- CSS
660
- [foo=bar].baz {a: b}
661
- [foo^=bar] {@extend .baz}
662
- SCSS
663
-
664
- assert_equal <<CSS, render(<<SCSS)
665
- [foo=bar].baz, [foo=bar][foot=bar] {
666
- a: b; }
667
- CSS
668
- [foo=bar].baz {a: b}
669
- [foot=bar] {@extend .baz}
670
- SCSS
671
-
672
- assert_equal <<CSS, render(<<SCSS)
673
- [foo=bar].baz, [foo=bar][ns|foo=bar] {
674
- a: b; }
675
- CSS
676
- [foo=bar].baz {a: b}
677
- [ns|foo=bar] {@extend .baz}
678
- SCSS
679
-
680
- assert_equal <<CSS, render(<<SCSS)
681
- [foo=bar] {
682
- a: b; }
683
- CSS
684
- [foo=bar].baz {a: b}
685
- [foo=bar] {@extend .baz}
686
- SCSS
687
- end
688
-
689
- def test_pseudo_unification
690
- assert_equal <<CSS, render(<<SCSS)
691
- :foo.baz, :foo:foo(2n+1) {
692
- a: b; }
693
- CSS
694
- :foo.baz {a: b}
695
- :foo(2n+1) {@extend .baz}
696
- SCSS
697
-
698
- assert_equal <<CSS, render(<<SCSS)
699
- :foo.baz, :foo::foo {
700
- a: b; }
701
- CSS
702
- :foo.baz {a: b}
703
- ::foo {@extend .baz}
704
- SCSS
705
-
706
- assert_equal <<CSS, render(<<SCSS)
707
- ::foo.baz {
708
- a: b; }
709
- CSS
710
- ::foo.baz {a: b}
711
- ::bar {@extend .baz}
712
- SCSS
713
-
714
- assert_equal <<CSS, render(<<SCSS)
715
- ::foo.baz {
716
- a: b; }
717
- CSS
718
- ::foo.baz {a: b}
719
- ::foo(2n+1) {@extend .baz}
720
- SCSS
721
-
722
- assert_equal <<CSS, render(<<SCSS)
723
- ::foo {
724
- a: b; }
725
- CSS
726
- ::foo.baz {a: b}
727
- ::foo {@extend .baz}
728
- SCSS
729
-
730
- assert_equal <<CSS, render(<<SCSS)
731
- ::foo(2n+1) {
732
- a: b; }
733
- CSS
734
- ::foo(2n+1).baz {a: b}
735
- ::foo(2n+1) {@extend .baz}
736
- SCSS
737
-
738
- assert_equal <<CSS, render(<<SCSS)
739
- :foo.baz, :foo:bar {
740
- a: b; }
741
- CSS
742
- :foo.baz {a: b}
743
- :bar {@extend .baz}
744
- SCSS
745
-
746
- assert_equal <<CSS, render(<<SCSS)
747
- :foo {
748
- a: b; }
749
- CSS
750
- :foo.baz {a: b}
751
- :foo {@extend .baz}
752
- SCSS
753
- end
754
-
755
- def test_pseudoelement_remains_at_end_of_selector
756
- assert_equal <<CSS, render(<<SCSS)
757
- .foo::bar, .baz::bar {
758
- a: b; }
759
- CSS
760
- .foo::bar {a: b}
761
- .baz {@extend .foo}
762
- SCSS
763
-
764
- assert_equal <<CSS, render(<<SCSS)
765
- a.foo::bar, a.baz::bar {
766
- a: b; }
767
- CSS
768
- a.foo::bar {a: b}
769
- .baz {@extend .foo}
770
- SCSS
771
- end
772
-
773
- def test_pseudoclass_remains_at_end_of_selector
774
- assert_equal <<CSS, render(<<SCSS)
775
- .foo:bar, .baz:bar {
776
- a: b; }
777
- CSS
778
- .foo:bar {a: b}
779
- .baz {@extend .foo}
780
- SCSS
781
-
782
- assert_equal <<CSS, render(<<SCSS)
783
- a.foo:bar, a.baz:bar {
784
- a: b; }
785
- CSS
786
- a.foo:bar {a: b}
787
- .baz {@extend .foo}
788
- SCSS
789
- end
790
-
791
- def test_not_remains_at_end_of_selector
792
- assert_equal <<CSS, render(<<SCSS)
793
- .foo:not(.bar), .baz:not(.bar) {
794
- a: b; }
795
- CSS
796
- .foo:not(.bar) {a: b}
797
- .baz {@extend .foo}
798
- SCSS
799
- end
800
-
801
- def test_pseudoelement_goes_lefter_than_pseudoclass
802
- assert_equal <<CSS, render(<<SCSS)
803
- .foo::bar, .baz:bang::bar {
804
- a: b; }
805
- CSS
806
- .foo::bar {a: b}
807
- .baz:bang {@extend .foo}
808
- SCSS
809
-
810
- assert_equal <<CSS, render(<<SCSS)
811
- .foo:bar, .baz:bar::bang {
812
- a: b; }
813
- CSS
814
- .foo:bar {a: b}
815
- .baz::bang {@extend .foo}
816
- SCSS
817
- end
818
-
819
- def test_pseudoelement_goes_lefter_than_not
820
- assert_equal <<CSS, render(<<SCSS)
821
- .foo::bar, .baz:not(.bang)::bar {
822
- a: b; }
823
- CSS
824
- .foo::bar {a: b}
825
- .baz:not(.bang) {@extend .foo}
826
- SCSS
827
-
828
- assert_equal <<CSS, render(<<SCSS)
829
- .foo:not(.bang), .baz:not(.bang)::bar {
830
- a: b; }
831
- CSS
832
- .foo:not(.bang) {a: b}
833
- .baz::bar {@extend .foo}
834
- SCSS
835
- end
836
-
837
- def test_negation_unification
838
- assert_equal <<CSS, render(<<SCSS)
839
- :not(.foo).baz, :not(.foo):not(.bar) {
840
- a: b; }
841
- CSS
842
- :not(.foo).baz {a: b}
843
- :not(.bar) {@extend .baz}
844
- SCSS
845
-
846
- assert_equal <<CSS, render(<<SCSS)
847
- :not(.foo) {
848
- a: b; }
849
- CSS
850
- :not(.foo).baz {a: b}
851
- :not(.foo) {@extend .baz}
852
- SCSS
853
-
854
- assert_equal <<CSS, render(<<SCSS)
855
- :not([a=b]) {
856
- a: b; }
857
- CSS
858
- :not([a=b]).baz {a: b}
859
- :not([a = b]) {@extend .baz}
860
- SCSS
861
- end
862
-
863
- ## Long Extendees
864
-
865
- def test_long_extendee
866
- assert_equal <<CSS, render(<<SCSS)
867
- .foo.bar, .baz {
868
- a: b; }
869
- CSS
870
- .foo.bar {a: b}
871
- .baz {@extend .foo.bar}
872
- SCSS
873
- end
874
-
875
- def test_long_extendee_requires_all_selectors
876
- assert_equal <<CSS, render(<<SCSS)
877
- .foo {
878
- a: b; }
879
- CSS
880
- .foo {a: b}
881
- .baz {@extend .foo.bar}
882
- SCSS
883
- end
884
-
885
- def test_long_extendee_matches_supersets
886
- assert_equal <<CSS, render(<<SCSS)
887
- .foo.bar.bap, .bap.baz {
888
- a: b; }
889
- CSS
890
- .foo.bar.bap {a: b}
891
- .baz {@extend .foo.bar}
892
- SCSS
893
- end
894
-
895
- def test_long_extendee_runs_unification
896
- assert_equal <<CSS, render(<<SCSS)
897
- ns|*.foo.bar, ns|a.baz {
898
- a: b; }
899
- CSS
900
- ns|*.foo.bar {a: b}
901
- a.baz {@extend .foo.bar}
902
- SCSS
903
- end
904
-
905
- ## Long Extenders
906
-
907
- def test_long_extender
908
- assert_equal <<CSS, render(<<SCSS)
909
- .foo.bar, .bar.baz.bang {
910
- a: b; }
911
- CSS
912
- .foo.bar {a: b}
913
- .baz.bang {@extend .foo}
914
- SCSS
915
- end
916
-
917
- def test_long_extender_runs_unification
918
- assert_equal <<CSS, render(<<SCSS)
919
- ns|*.foo.bar, ns|a.bar.baz {
920
- a: b; }
921
- CSS
922
- ns|*.foo.bar {a: b}
923
- a.baz {@extend .foo}
924
- SCSS
925
- end
926
-
927
- def test_long_extender_aborts_unification
928
- assert_equal <<CSS, render(<<SCSS)
929
- a.foo#bar {
930
- a: b; }
931
- CSS
932
- a.foo#bar {a: b}
933
- h1.baz {@extend .foo}
934
- SCSS
935
-
936
- assert_equal <<CSS, render(<<SCSS)
937
- a.foo#bar {
938
- a: b; }
939
- CSS
940
- a.foo#bar {a: b}
941
- .bang#baz {@extend .foo}
942
- SCSS
943
- end
944
-
945
- ## Nested Extenders
946
-
947
- def test_nested_extender
948
- assert_equal <<CSS, render(<<SCSS)
949
- .foo, foo bar {
950
- a: b; }
951
- CSS
952
- .foo {a: b}
953
- foo bar {@extend .foo}
954
- SCSS
955
- end
956
-
957
- def test_nested_extender_runs_unification
958
- assert_equal <<CSS, render(<<SCSS)
959
- .foo.bar, foo bar.bar {
960
- a: b; }
961
- CSS
962
- .foo.bar {a: b}
963
- foo bar {@extend .foo}
964
- SCSS
965
- end
966
-
967
- def test_nested_extender_aborts_unification
968
- assert_equal <<CSS, render(<<SCSS)
969
- baz.foo {
970
- a: b; }
971
- CSS
972
- baz.foo {a: b}
973
- foo bar {@extend .foo}
974
- SCSS
975
- end
976
-
977
- def test_nested_extender_alternates_parents
978
- assert_equal <<CSS, render(<<SCSS)
979
- .baz .bip .foo, .baz .bip foo .grank bar, foo .grank .baz .bip bar {
980
- a: b; }
981
- CSS
982
- .baz .bip .foo {a: b}
983
- foo .grank bar {@extend .foo}
984
- SCSS
985
- end
986
-
987
- def test_nested_extender_unifies_identical_parents
988
- assert_equal <<CSS, render(<<SCSS)
989
- .baz .bip .foo, .baz .bip bar {
990
- a: b; }
991
- CSS
992
- .baz .bip .foo {a: b}
993
- .baz .bip bar {@extend .foo}
994
- SCSS
995
- end
996
-
997
- def test_nested_extender_unifies_common_substring
998
- assert_equal <<CSS, render(<<SCSS)
999
- .baz .bip .bap .bink .foo, .baz .brat .bip .bap .bink bar, .brat .baz .bip .bap .bink bar {
1000
- a: b; }
1001
- CSS
1002
- .baz .bip .bap .bink .foo {a: b}
1003
- .brat .bip .bap bar {@extend .foo}
1004
- SCSS
1005
- end
1006
-
1007
- def test_nested_extender_unifies_common_subseq
1008
- assert_equal <<CSS, render(<<SCSS)
1009
- .a .x .b .y .foo, .a .x .n .b .y .m bar, .a .n .x .b .y .m bar, .a .x .n .b .m .y bar, .a .n .x .b .m .y bar {
1010
- a: b; }
1011
- CSS
1012
- .a .x .b .y .foo {a: b}
1013
- .a .n .b .m bar {@extend .foo}
1014
- SCSS
1015
- end
1016
-
1017
- def test_nested_extender_chooses_first_subseq
1018
- assert_equal <<CSS, render(<<SCSS)
1019
- .a .b .c .d .foo, .a .b .c .d .a .b .bar {
1020
- a: b; }
1021
- CSS
1022
- .a .b .c .d .foo {a: b}
1023
- .c .d .a .b .bar {@extend .foo}
1024
- SCSS
1025
- end
1026
-
1027
- def test_nested_extender_counts_extended_subselectors
1028
- assert_equal <<CSS, render(<<SCSS)
1029
- .a .bip.bop .foo, .a .b .bip.bop .bar, .b .a .bip.bop .bar {
1030
- a: b; }
1031
- CSS
1032
- .a .bip.bop .foo {a: b}
1033
- .b .bip .bar {@extend .foo}
1034
- SCSS
1035
- end
1036
-
1037
- def test_nested_extender_counts_extended_superselectors
1038
- assert_equal <<CSS, render(<<SCSS)
1039
- .a .bip .foo, .a .b .bip.bop .bar, .b .a .bip.bop .bar {
1040
- a: b; }
1041
- CSS
1042
- .a .bip .foo {a: b}
1043
- .b .bip.bop .bar {@extend .foo}
1044
- SCSS
1045
- end
1046
-
1047
- def test_nested_extender_with_child_selector
1048
- assert_equal <<CSS, render(<<SCSS)
1049
- .baz .foo, .baz foo > bar {
1050
- a: b; }
1051
- CSS
1052
- .baz .foo {a: b}
1053
- foo > bar {@extend .foo}
1054
- SCSS
1055
- end
1056
-
1057
- def test_nested_extender_finds_common_selectors_around_child_selector
1058
- assert_equal <<CSS, render(<<SCSS)
1059
- a > b c .c1, a > b c .c2 {
1060
- a: b; }
1061
- CSS
1062
- a > b c .c1 {a: b}
1063
- a c .c2 {@extend .c1}
1064
- SCSS
1065
-
1066
- assert_equal <<CSS, render(<<SCSS)
1067
- a > b c .c1, a > b c .c2 {
1068
- a: b; }
1069
- CSS
1070
- a > b c .c1 {a: b}
1071
- b c .c2 {@extend .c1}
1072
- SCSS
1073
- end
1074
-
1075
- def test_nested_extender_doesnt_find_common_selectors_around_adjacent_sibling_selector
1076
- assert_equal <<CSS, render(<<SCSS)
1077
- a + b c .c1, a + b a c .c2, a a + b c .c2 {
1078
- a: b; }
1079
- CSS
1080
- a + b c .c1 {a: b}
1081
- a c .c2 {@extend .c1}
1082
- SCSS
1083
-
1084
- assert_equal <<CSS, render(<<SCSS)
1085
- a + b c .c1, a a + b c .c2 {
1086
- a: b; }
1087
- CSS
1088
- a + b c .c1 {a: b}
1089
- a b .c2 {@extend .c1}
1090
- SCSS
1091
-
1092
- assert_equal <<CSS, render(<<SCSS)
1093
- a + b c .c1, a + b c .c2 {
1094
- a: b; }
1095
- CSS
1096
- a + b c .c1 {a: b}
1097
- b c .c2 {@extend .c1}
1098
- SCSS
1099
- end
1100
-
1101
- def test_nested_extender_doesnt_find_common_selectors_around_sibling_selector
1102
- assert_equal <<CSS, render(<<SCSS)
1103
- a ~ b c .c1, a ~ b a c .c2, a a ~ b c .c2 {
1104
- a: b; }
1105
- CSS
1106
- a ~ b c .c1 {a: b}
1107
- a c .c2 {@extend .c1}
1108
- SCSS
1109
-
1110
- assert_equal <<CSS, render(<<SCSS)
1111
- a ~ b c .c1, a a ~ b c .c2 {
1112
- a: b; }
1113
- CSS
1114
- a ~ b c .c1 {a: b}
1115
- a b .c2 {@extend .c1}
1116
- SCSS
1117
-
1118
- assert_equal <<CSS, render(<<SCSS)
1119
- a ~ b c .c1, a ~ b c .c2 {
1120
- a: b; }
1121
- CSS
1122
- a ~ b c .c1 {a: b}
1123
- b c .c2 {@extend .c1}
1124
- SCSS
1125
- end
1126
-
1127
- def test_nested_extender_with_early_child_selectors_doesnt_subseq_them
1128
- assert_equal <<CSS, render(<<SCSS)
1129
- .bip > .bap .foo, .bip > .bap .grip > .bap .bar, .grip > .bap .bip > .bap .bar {
1130
- a: b; }
1131
- CSS
1132
- .bip > .bap .foo {a: b}
1133
- .grip > .bap .bar {@extend .foo}
1134
- SCSS
1135
-
1136
- assert_equal <<CSS, render(<<SCSS)
1137
- .bap > .bip .foo, .bap > .bip .bap > .grip .bar, .bap > .grip .bap > .bip .bar {
1138
- a: b; }
1139
- CSS
1140
- .bap > .bip .foo {a: b}
1141
- .bap > .grip .bar {@extend .foo}
1142
- SCSS
1143
- end
1144
-
1145
- def test_nested_extender_with_child_selector_unifies
1146
- assert_equal <<CSS, render(<<SCSS)
1147
- .baz.foo, foo > bar.baz {
1148
- a: b; }
1149
- CSS
1150
- .baz.foo {a: b}
1151
- foo > bar {@extend .foo}
1152
- SCSS
1153
- end
1154
-
1155
- def test_nested_extender_with_trailing_child_selector
1156
- assert_raise(Sass::SyntaxError, "bar > can't extend: invalid selector") do
1157
- render("bar > {@extend .baz}")
1158
- end
1159
- end
1160
-
1161
- def test_nested_extender_with_sibling_selector
1162
- assert_equal <<CSS, render(<<SCSS)
1163
- .baz .foo, .baz foo + bar {
1164
- a: b; }
1165
- CSS
1166
- .baz .foo {a: b}
1167
- foo + bar {@extend .foo}
1168
- SCSS
1169
- end
1170
-
1171
- def test_nested_extender_with_hacky_selector
1172
- assert_equal <<CSS, render(<<SCSS)
1173
- .baz .foo, .baz foo + > > + bar {
1174
- a: b; }
1175
- CSS
1176
- .baz .foo {a: b}
1177
- foo + > > + bar {@extend .foo}
1178
- SCSS
1179
-
1180
- assert_equal <<CSS, render(<<SCSS)
1181
- .baz .foo, .baz > > bar {
1182
- a: b; }
1183
- CSS
1184
- .baz .foo {a: b}
1185
- > > bar {@extend .foo}
1186
- SCSS
1187
- end
1188
-
1189
- def test_nested_extender_merges_with_same_selector
1190
- assert_equal <<CSS, render(<<SCSS)
1191
- .foo .bar, .foo .baz {
1192
- a: b; }
1193
- CSS
1194
- .foo {
1195
- .bar {a: b}
1196
- .baz {@extend .bar} }
1197
- SCSS
1198
- end
1199
-
1200
- def test_nested_extender_with_child_selector_merges_with_same_selector
1201
- assert_equal <<CSS, render(<<SCSS)
1202
- .foo > .bar .baz, .foo > .bar .bang {
1203
- a: b; }
1204
- CSS
1205
- .foo > .bar .baz {a: b}
1206
- .foo > .bar .bang {@extend .baz}
1207
- SCSS
1208
- end
1209
-
1210
- # Loops
1211
-
1212
- def test_extend_self_loop
1213
- assert_equal <<CSS, render(<<SCSS)
1214
- .foo {
1215
- a: b; }
1216
- CSS
1217
- .foo {a: b; @extend .foo}
1218
- SCSS
1219
- end
1220
-
1221
- def test_basic_extend_loop
1222
- assert_equal <<CSS, render(<<SCSS)
1223
- .bar, .foo {
1224
- a: b; }
1225
-
1226
- .foo, .bar {
1227
- c: d; }
1228
- CSS
1229
- .foo {a: b; @extend .bar}
1230
- .bar {c: d; @extend .foo}
1231
- SCSS
1232
- end
1233
-
1234
- def test_three_level_extend_loop
1235
- assert_equal <<CSS, render(<<SCSS)
1236
- .baz, .bar, .foo {
1237
- a: b; }
1238
-
1239
- .foo, .baz, .bar {
1240
- c: d; }
1241
-
1242
- .bar, .foo, .baz {
1243
- e: f; }
1244
- CSS
1245
- .foo {a: b; @extend .bar}
1246
- .bar {c: d; @extend .baz}
1247
- .baz {e: f; @extend .foo}
1248
- SCSS
1249
- end
1250
-
1251
- def test_nested_extend_loop
1252
- assert_equal <<CSS, render(<<SCSS)
1253
- .bar, .bar .foo {
1254
- a: b; }
1255
- .bar .foo, .bar .foo .foo {
1256
- c: d; }
1257
- CSS
1258
- .bar {
1259
- a: b;
1260
- .foo {c: d; @extend .bar}
1261
- }
1262
- SCSS
1263
- end
1264
-
1265
- def test_multiple_extender_merges_with_superset_selector
1266
- assert_equal <<CSS, render(<<SCSS)
1267
- a.bar.baz, a.foo {
1268
- a: b; }
1269
- CSS
1270
- .foo {@extend .bar; @extend .baz}
1271
- a.bar.baz {a: b}
1272
- SCSS
1273
- end
1274
-
1275
- def test_control_flow_if
1276
- assert_equal <<CSS, render(<<SCSS)
1277
- .true, .also-true {
1278
- color: green; }
1279
-
1280
- .false, .also-false {
1281
- color: red; }
1282
- CSS
1283
- .true { color: green; }
1284
- .false { color: red; }
1285
- .also-true {
1286
- @if true { @extend .true; }
1287
- @else { @extend .false; }
1288
- }
1289
- .also-false {
1290
- @if false { @extend .true; }
1291
- @else { @extend .false; }
1292
- }
1293
- SCSS
1294
- end
1295
-
1296
- def test_control_flow_for
1297
- assert_equal <<CSS, render(<<SCSS)
1298
- .base-0, .added {
1299
- color: green; }
1300
-
1301
- .base-1, .added {
1302
- display: block; }
1303
-
1304
- .base-2, .added {
1305
- border: 1px solid blue; }
1306
- CSS
1307
- .base-0 { color: green; }
1308
- .base-1 { display: block; }
1309
- .base-2 { border: 1px solid blue; }
1310
- .added {
1311
- @for $i from 0 to 3 {
1312
- @extend .base-\#{$i};
1313
- }
1314
- }
1315
- SCSS
1316
- end
1317
-
1318
- def test_control_flow_while
1319
- assert_equal <<CSS, render(<<SCSS)
1320
- .base-0, .added {
1321
- color: green; }
1322
-
1323
- .base-1, .added {
1324
- display: block; }
1325
-
1326
- .base-2, .added {
1327
- border: 1px solid blue; }
1328
- CSS
1329
- .base-0 { color: green; }
1330
- .base-1 { display: block; }
1331
- .base-2 { border: 1px solid blue; }
1332
- .added {
1333
- $i : 0;
1334
- @while $i < 3 {
1335
- @extend .base-\#{$i};
1336
- $i : $i + 1;
1337
- }
1338
- }
1339
- SCSS
1340
- end
1341
-
1342
- private
1343
-
1344
- def render(sass, options = {})
1345
- munge_filename options
1346
- Sass::Engine.new(sass, {:syntax => :scss}.merge(options)).render
1347
- end
1348
- end