compass 0.12.7 → 0.13.alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. data/README.markdown +1 -1
  2. data/Rakefile +14 -9
  3. data/VERSION.yml +6 -0
  4. data/features/command_line.feature +8 -50
  5. data/features/step_definitions/command_line_steps.rb +3 -2
  6. data/frameworks/compass/stylesheets/compass/_css3.scss +2 -0
  7. data/frameworks/compass/stylesheets/compass/_support.scss +4 -4
  8. data/frameworks/compass/stylesheets/compass/css3/_animation.scss +121 -0
  9. data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +10 -6
  10. data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +32 -36
  11. data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +32 -35
  12. data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +12 -15
  13. data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +27 -48
  14. data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +22 -35
  15. data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +12 -8
  16. data/frameworks/compass/stylesheets/compass/css3/_box.scss +57 -82
  17. data/frameworks/compass/stylesheets/compass/css3/_columns.scss +104 -71
  18. data/frameworks/compass/stylesheets/compass/css3/_filter.scss +38 -18
  19. data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +294 -0
  20. data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +4 -4
  21. data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +13 -22
  22. data/frameworks/compass/stylesheets/compass/css3/_images.scss +45 -48
  23. data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +1 -1
  24. data/frameworks/compass/stylesheets/compass/css3/_regions.scss +12 -8
  25. data/frameworks/compass/stylesheets/compass/css3/_selection.scss +31 -0
  26. data/frameworks/compass/stylesheets/compass/css3/_shared.scss +226 -2
  27. data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +21 -26
  28. data/frameworks/compass/stylesheets/compass/css3/_transform-legacy.scss +3 -3
  29. data/frameworks/compass/stylesheets/compass/css3/_transform.scss +8 -8
  30. data/frameworks/compass/stylesheets/compass/css3/_transition.scss +3 -3
  31. data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +43 -4
  32. data/frameworks/compass/stylesheets/compass/typography/_units.scss +152 -0
  33. data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +180 -102
  34. data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +5 -3
  35. data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +6 -3
  36. data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +1 -1
  37. data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +7 -3
  38. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +2 -2
  39. data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +32 -13
  40. data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +14 -9
  41. data/lib/compass/actions.rb +3 -1
  42. data/lib/compass/commands/update_project.rb +1 -2
  43. data/lib/compass/commands/watch_project.rb +11 -113
  44. data/lib/compass/commands.rb +1 -1
  45. data/lib/compass/compiler.rb +8 -1
  46. data/lib/compass/configuration/data.rb +1 -1
  47. data/lib/compass/configuration/helpers.rb +2 -0
  48. data/lib/compass/exec/project_options_parser.rb +8 -0
  49. data/lib/compass/logger.rb +2 -0
  50. data/lib/compass/sass_extensions/functions/cross_browser_support.rb +1 -1
  51. data/lib/compass/sass_extensions/functions/env.rb +18 -0
  52. data/lib/compass/sass_extensions/functions/gradient_support.rb +101 -29
  53. data/lib/compass/sass_extensions/functions/image_size.rb +2 -1
  54. data/lib/compass/sass_extensions/functions/math.rb +13 -1
  55. data/lib/compass/sass_extensions/functions/sprites.rb +82 -22
  56. data/lib/compass/sass_extensions/functions/urls.rb +37 -6
  57. data/lib/compass/sass_extensions/functions/utility.rb +10 -0
  58. data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +11 -9
  59. data/lib/compass/sass_extensions/sprites/image.rb +7 -2
  60. data/lib/compass/sass_extensions/sprites/image_methods.rb +5 -1
  61. data/lib/compass/sass_extensions/sprites/images.rb +29 -0
  62. data/lib/compass/sass_extensions/sprites/layout/diagonal.rb +42 -0
  63. data/lib/compass/sass_extensions/sprites/layout/horizontal.rb +66 -0
  64. data/lib/compass/sass_extensions/sprites/layout/smart.rb +33 -0
  65. data/lib/compass/sass_extensions/sprites/layout/vertical.rb +68 -0
  66. data/lib/compass/sass_extensions/sprites/layout.rb +39 -0
  67. data/lib/compass/sass_extensions/sprites/layout_methods.rb +9 -115
  68. data/lib/compass/sass_extensions/sprites/sprite_map.rb +5 -1
  69. data/lib/compass/sass_extensions/sprites/sprite_methods.rb +8 -14
  70. data/lib/compass/sass_extensions/sprites.rb +2 -0
  71. data/lib/compass/sprite_importer/content.erb +29 -24
  72. data/lib/compass/sprite_importer.rb +7 -11
  73. data/lib/compass/version.rb +10 -13
  74. data/lib/compass/watcher/compiler.rb +59 -0
  75. data/lib/compass/watcher/project_watcher.rb +111 -0
  76. data/lib/compass/watcher/watch.rb +33 -0
  77. data/lib/compass/watcher.rb +11 -0
  78. data/lib/compass.rb +2 -2
  79. data/test/fixtures/sprites/public/images/numeric/200.png +0 -0
  80. data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
  81. data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +7 -0
  82. data/test/fixtures/stylesheets/busted_font_urls/fonts/feed.ttf +0 -0
  83. data/test/fixtures/stylesheets/busted_font_urls/fonts/grid.ttf +0 -0
  84. data/test/fixtures/stylesheets/busted_font_urls/fonts/sub/dk.ttf +0 -0
  85. data/test/fixtures/stylesheets/busted_font_urls/sass/screen.sass +11 -0
  86. data/test/fixtures/stylesheets/busted_font_urls/tmp/screen.css +7 -0
  87. data/test/fixtures/stylesheets/busted_image_urls/tmp/screen.css +9 -0
  88. data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +33 -0
  89. data/test/fixtures/stylesheets/compass/css/animation.css +33 -0
  90. data/test/fixtures/stylesheets/compass/css/background-clip.css +5 -0
  91. data/test/fixtures/stylesheets/compass/css/background-origin.css +15 -0
  92. data/test/fixtures/stylesheets/compass/css/background-size.css +24 -0
  93. data/test/fixtures/stylesheets/compass/css/columns.css +27 -63
  94. data/test/fixtures/stylesheets/compass/css/flexbox.css +121 -0
  95. data/test/fixtures/stylesheets/compass/css/fonts.css +1 -1
  96. data/test/fixtures/stylesheets/compass/css/gradients.css +64 -36
  97. data/test/fixtures/stylesheets/compass/css/grid_background.css +7 -14
  98. data/test/fixtures/stylesheets/compass/css/hyphenation.css +4 -2
  99. data/test/fixtures/stylesheets/compass/css/lists.css +5 -5
  100. data/test/fixtures/stylesheets/compass/css/pie.css +0 -3
  101. data/test/fixtures/stylesheets/compass/css/regions.css +4 -2
  102. data/test/fixtures/stylesheets/compass/css/selection.css +13 -0
  103. data/test/fixtures/stylesheets/compass/css/sprites.css +251 -250
  104. data/test/fixtures/stylesheets/compass/css/text_shadow.css +6 -6
  105. data/test/fixtures/stylesheets/compass/css/transition.css +6 -0
  106. data/test/fixtures/stylesheets/compass/css/units.css +30 -0
  107. data/test/fixtures/stylesheets/compass/css/user-interface.css +22 -1
  108. data/test/fixtures/stylesheets/compass/css/utilities.css +15 -0
  109. data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +177 -8
  110. data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
  111. data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +19 -0
  112. data/test/fixtures/stylesheets/compass/sass/animation.scss +13 -0
  113. data/test/fixtures/stylesheets/compass/sass/background-clip.scss +4 -2
  114. data/test/fixtures/stylesheets/compass/sass/background-origin.scss +10 -0
  115. data/test/fixtures/stylesheets/compass/sass/background-size.scss +12 -0
  116. data/test/fixtures/stylesheets/compass/sass/columns.scss +9 -9
  117. data/test/fixtures/stylesheets/compass/sass/flexbox.scss +44 -0
  118. data/test/fixtures/stylesheets/compass/sass/gradients.sass +31 -0
  119. data/test/fixtures/stylesheets/compass/sass/selection.scss +13 -0
  120. data/test/fixtures/stylesheets/compass/sass/transition.scss +1 -1
  121. data/test/fixtures/stylesheets/compass/sass/units.scss +45 -0
  122. data/test/fixtures/stylesheets/compass/sass/user-interface.scss +13 -1
  123. data/test/fixtures/stylesheets/compass/sass/utilities.scss +10 -0
  124. data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +208 -7
  125. data/test/fixtures/stylesheets/envtest/css/env.css +8 -0
  126. data/test/fixtures/stylesheets/envtest/sass/env.scss +16 -0
  127. data/test/fixtures/stylesheets/envtest/tmp/env.css +14 -0
  128. data/test/fixtures/stylesheets/valid/css/simple.css +4 -0
  129. data/test/helpers/diff.rb +1 -1
  130. data/test/integrations/compass_test.rb +23 -14
  131. data/test/integrations/sprites_test.rb +305 -63
  132. data/test/test_helper.rb +5 -15
  133. data/test/units/command_line_test.rb +0 -2
  134. data/test/units/compass_module_test.rb +1 -1
  135. data/test/units/configuration_test.rb +12 -0
  136. data/test/units/regressions_test.rb +8 -8
  137. data/test/units/sass_extensions_test.rb +2 -0
  138. data/test/units/sass_extenstions/gradients_test.rb +33 -0
  139. data/test/units/sprites/image_test.rb +5 -0
  140. data/test/units/sprites/images_test.rb +46 -0
  141. data/test/units/sprites/layout_test.rb +29 -4
  142. data/test/units/watcher/compiler_test.rb +39 -0
  143. data/test/units/watcher/project_watcher_test.rb +73 -0
  144. data/test/units/watcher/watch_test.rb +42 -0
  145. metadata +171 -236
  146. checksums.yaml +0 -7
  147. data/frameworks/blueprint/stylesheets/_blueprint.scss +0 -37
  148. data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +0 -101
  149. data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +0 -36
  150. data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +0 -28
  151. data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +0 -88
  152. data/frameworks/blueprint/stylesheets/blueprint/_form.scss +0 -66
  153. data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +0 -258
  154. data/frameworks/blueprint/stylesheets/blueprint/_ie.scss +0 -111
  155. data/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +0 -66
  156. data/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +0 -37
  157. data/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +0 -152
  158. data/frameworks/blueprint/stylesheets/blueprint/_print.scss +0 -86
  159. data/frameworks/blueprint/stylesheets/blueprint/_reset.scss +0 -3
  160. data/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +0 -121
  161. data/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +0 -52
  162. data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +0 -90
  163. data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +0 -37
  164. data/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +0 -83
  165. data/frameworks/blueprint/templates/basic/grid.png +0 -0
  166. data/frameworks/blueprint/templates/basic/ie.sass +0 -4
  167. data/frameworks/blueprint/templates/basic/manifest.rb +0 -30
  168. data/frameworks/blueprint/templates/basic/partials/_base.sass +0 -10
  169. data/frameworks/blueprint/templates/basic/print.sass +0 -4
  170. data/frameworks/blueprint/templates/basic/screen.sass +0 -12
  171. data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
  172. data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
  173. data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
  174. data/frameworks/blueprint/templates/buttons/buttons.sass +0 -49
  175. data/frameworks/blueprint/templates/buttons/manifest.rb +0 -17
  176. data/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
  177. data/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
  178. data/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
  179. data/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
  180. data/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
  181. data/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
  182. data/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
  183. data/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
  184. data/frameworks/blueprint/templates/link_icons/link_icons.sass +0 -13
  185. data/frameworks/blueprint/templates/link_icons/manifest.rb +0 -23
  186. data/frameworks/blueprint/templates/project/grid.png +0 -0
  187. data/frameworks/blueprint/templates/project/ie.sass +0 -16
  188. data/frameworks/blueprint/templates/project/manifest.rb +0 -30
  189. data/frameworks/blueprint/templates/project/partials/_base.sass +0 -11
  190. data/frameworks/blueprint/templates/project/print.sass +0 -8
  191. data/frameworks/blueprint/templates/project/screen.sass +0 -46
  192. data/frameworks/blueprint/templates/semantic/grid.png +0 -0
  193. data/frameworks/blueprint/templates/semantic/ie.sass +0 -16
  194. data/frameworks/blueprint/templates/semantic/manifest.rb +0 -33
  195. data/frameworks/blueprint/templates/semantic/partials/_base.sass +0 -10
  196. data/frameworks/blueprint/templates/semantic/partials/_form.sass +0 -6
  197. data/frameworks/blueprint/templates/semantic/partials/_page.sass +0 -17
  198. data/frameworks/blueprint/templates/semantic/partials/_two_col.sass +0 -38
  199. data/frameworks/blueprint/templates/semantic/print.sass +0 -5
  200. data/frameworks/blueprint/templates/semantic/screen.sass +0 -14
  201. data/lib/compass/commands/generate_grid_background.rb +0 -96
  202. data/lib/compass/grid_builder.rb +0 -102
  203. data/test/fixtures/stylesheets/blueprint/config.rb +0 -14
  204. data/test/fixtures/stylesheets/blueprint/css/ie.css +0 -76
  205. data/test/fixtures/stylesheets/blueprint/css/print.css +0 -56
  206. data/test/fixtures/stylesheets/blueprint/css/screen.css +0 -815
  207. data/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css +0 -56
  208. data/test/fixtures/stylesheets/blueprint/css/single-imports/colors.css +0 -80
  209. data/test/fixtures/stylesheets/blueprint/css/single-imports/debug.css +0 -11
  210. data/test/fixtures/stylesheets/blueprint/css/single-imports/fancy-type.css +0 -30
  211. data/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +0 -42
  212. data/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +0 -435
  213. data/test/fixtures/stylesheets/blueprint/css/single-imports/ie.css +0 -76
  214. data/test/fixtures/stylesheets/blueprint/css/single-imports/interaction.css +0 -46
  215. data/test/fixtures/stylesheets/blueprint/css/single-imports/link-icons.css +0 -40
  216. data/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css +0 -651
  217. data/test/fixtures/stylesheets/blueprint/css/single-imports/print.css +0 -60
  218. data/test/fixtures/stylesheets/blueprint/css/single-imports/reset-utilities.css +0 -75
  219. data/test/fixtures/stylesheets/blueprint/css/single-imports/reset.css +0 -42
  220. data/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +0 -437
  221. data/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +0 -45
  222. data/test/fixtures/stylesheets/blueprint/css/single-imports/typography.css +0 -146
  223. data/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +0 -35
  224. data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
  225. data/test/fixtures/stylesheets/blueprint/images/link_icons/doc.png +0 -0
  226. data/test/fixtures/stylesheets/blueprint/images/link_icons/email.png +0 -0
  227. data/test/fixtures/stylesheets/blueprint/images/link_icons/external.png +0 -0
  228. data/test/fixtures/stylesheets/blueprint/images/link_icons/feed.png +0 -0
  229. data/test/fixtures/stylesheets/blueprint/images/link_icons/im.png +0 -0
  230. data/test/fixtures/stylesheets/blueprint/images/link_icons/pdf.png +0 -0
  231. data/test/fixtures/stylesheets/blueprint/images/link_icons/visited.png +0 -0
  232. data/test/fixtures/stylesheets/blueprint/images/link_icons/xls.png +0 -0
  233. data/test/fixtures/stylesheets/blueprint/sass/ie.sass +0 -3
  234. data/test/fixtures/stylesheets/blueprint/sass/print.sass +0 -3
  235. data/test/fixtures/stylesheets/blueprint/sass/screen.sass +0 -18
  236. data/test/fixtures/stylesheets/blueprint/sass/single-imports/buttons.scss +0 -4
  237. data/test/fixtures/stylesheets/blueprint/sass/single-imports/colors.scss +0 -34
  238. data/test/fixtures/stylesheets/blueprint/sass/single-imports/debug.scss +0 -3
  239. data/test/fixtures/stylesheets/blueprint/sass/single-imports/fancy-type.scss +0 -3
  240. data/test/fixtures/stylesheets/blueprint/sass/single-imports/form.scss +0 -5
  241. data/test/fixtures/stylesheets/blueprint/sass/single-imports/grid.scss +0 -3
  242. data/test/fixtures/stylesheets/blueprint/sass/single-imports/ie.scss +0 -3
  243. data/test/fixtures/stylesheets/blueprint/sass/single-imports/interaction.scss +0 -3
  244. data/test/fixtures/stylesheets/blueprint/sass/single-imports/link-icons.scss +0 -13
  245. data/test/fixtures/stylesheets/blueprint/sass/single-imports/liquid.scss +0 -3
  246. data/test/fixtures/stylesheets/blueprint/sass/single-imports/print.scss +0 -5
  247. data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset-utilities.scss +0 -5
  248. data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset.scss +0 -1
  249. data/test/fixtures/stylesheets/blueprint/sass/single-imports/rtl.scss +0 -3
  250. data/test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss +0 -5
  251. data/test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss +0 -3
  252. data/test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss +0 -3
  253. data/test/fixtures/stylesheets/compass/images/flag-s4798b5a210.png +0 -0
  254. data/test/units/compass_png_test.rb +0 -46
@@ -13,6 +13,7 @@ class SpritesTest < Test::Unit::TestCase
13
13
  @images_tmp_path = File.join(File.dirname(__FILE__), '..', 'fixtures', 'sprites', 'public', 'images-tmp')
14
14
  @generated_images_tmp_path = File.join(File.dirname(__FILE__), '..', 'fixtures', 'sprites', 'public', 'generated-images-tmp')
15
15
  ::FileUtils.cp_r @images_src_path, @images_tmp_path
16
+ ::FileUtils.mkdir_p @generated_images_tmp_path
16
17
  file = StringIO.new("images_path = #{@images_tmp_path.inspect}\n")
17
18
  Compass.add_configuration(file, "sprite_config")
18
19
  Compass.configure_sass_plugin!
@@ -34,7 +35,7 @@ class SpritesTest < Test::Unit::TestCase
34
35
  end
35
36
 
36
37
  def image_size(file)
37
- open(map_location(file), "rb").read[0x10..0x18].unpack('NN')
38
+ Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(map_location(file)).size
38
39
  end
39
40
 
40
41
  def image_md5(file)
@@ -67,7 +68,8 @@ class SpritesTest < Test::Unit::TestCase
67
68
  SCSS
68
69
  assert_correct css, <<-CSS
69
70
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
70
- background: url('/squares-sbbc18e2129.png') no-repeat;
71
+ background-image: url('/squares-sbbc18e2129.png');
72
+ background-repeat: no-repeat;
71
73
  }
72
74
 
73
75
  .squares-ten-by-ten {
@@ -98,7 +100,8 @@ class SpritesTest < Test::Unit::TestCase
98
100
  assert_not_nil Dir.glob("#{@generated_images_tmp_path}/squares-s*.png").first
99
101
  assert_correct <<-CSS, css
100
102
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
101
- background: url('/images/generated/squares-sbbc18e2129.png') no-repeat;
103
+ background-image: url('/images/generated/squares-sbbc18e2129.png');
104
+ background-repeat: no-repeat;
102
105
  }
103
106
 
104
107
  .squares-ten-by-ten {
@@ -119,7 +122,8 @@ class SpritesTest < Test::Unit::TestCase
119
122
  SCSS
120
123
  assert_correct css, <<-CSS
121
124
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
122
- background: url('/squares-sbbc18e2129.png') no-repeat;
125
+ background-image: url('/squares-sbbc18e2129.png');
126
+ background-repeat: no-repeat;
123
127
  }
124
128
 
125
129
  .squares-ten-by-ten {
@@ -151,7 +155,8 @@ class SpritesTest < Test::Unit::TestCase
151
155
  SCSS
152
156
  assert_correct css, <<-CSS
153
157
  .squares-sprite, .cubicle, .large-cube {
154
- background: url('/squares-sbbc18e2129.png') no-repeat;
158
+ background-image: url('/squares-sbbc18e2129.png');
159
+ background-repeat: no-repeat;
155
160
  }
156
161
 
157
162
  .cubicle {
@@ -176,7 +181,8 @@ class SpritesTest < Test::Unit::TestCase
176
181
  SCSS
177
182
  assert_correct css, <<-CSS
178
183
  .circles {
179
- background: url('/squares-sbbc18e2129.png') no-repeat;
184
+ background-image: url('/squares-sbbc18e2129.png');
185
+ background-repeat: no-repeat;
180
186
  }
181
187
  CSS
182
188
  assert_equal image_size('squares-s*.png'), [20, 30]
@@ -190,7 +196,8 @@ class SpritesTest < Test::Unit::TestCase
190
196
  SCSS
191
197
  assert_correct css, <<-CSS
192
198
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
193
- background: url('/squares-s563a5e0855.png') no-repeat;
199
+ background-image: url('/squares-s563a5e0855.png');
200
+ background-repeat: no-repeat;
194
201
  }
195
202
 
196
203
  .squares-ten-by-ten {
@@ -212,7 +219,8 @@ class SpritesTest < Test::Unit::TestCase
212
219
  SCSS
213
220
  assert_correct css, <<-CSS
214
221
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
215
- background: url('/squares-s4ea353fa6d.png') no-repeat;
222
+ background-image: url('/squares-s4ea353fa6d.png');
223
+ background-repeat: no-repeat;
216
224
  }
217
225
 
218
226
  .squares-ten-by-ten {
@@ -235,7 +243,8 @@ class SpritesTest < Test::Unit::TestCase
235
243
  SCSS
236
244
  assert_correct css, <<-CSS
237
245
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
238
- background: url('/squares-sf4771cb124.png') no-repeat;
246
+ background-image: url('/squares-sf4771cb124.png');
247
+ background-repeat: no-repeat;
239
248
  }
240
249
 
241
250
  .squares-ten-by-ten {
@@ -258,7 +267,8 @@ class SpritesTest < Test::Unit::TestCase
258
267
  SCSS
259
268
  assert_correct css, <<-CSS
260
269
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
261
- background: url('/squares-sc82d6f3cf4.png') no-repeat;
270
+ background-image: url('/squares-sc82d6f3cf4.png');
271
+ background-repeat: no-repeat;
262
272
  }
263
273
 
264
274
  .squares-ten-by-ten {
@@ -280,7 +290,8 @@ class SpritesTest < Test::Unit::TestCase
280
290
  SCSS
281
291
  assert_correct css, <<-CSS
282
292
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
283
- background: url('/squares-s2f4aa65dcf.png') no-repeat;
293
+ background-image: url('/squares-s2f4aa65dcf.png');
294
+ background-repeat: no-repeat;
284
295
  }
285
296
 
286
297
  .squares-ten-by-ten {
@@ -298,7 +309,8 @@ class SpritesTest < Test::Unit::TestCase
298
309
  css = render <<-SCSS
299
310
  $squares: sprite-map("squares/*.png", $position: 100%);
300
311
  .squares-sprite {
301
- background: $squares no-repeat;
312
+ background-image: $squares;
313
+ background-repeat: no-repeat;
302
314
  }
303
315
 
304
316
  .adjusted-percentage {
@@ -315,7 +327,8 @@ class SpritesTest < Test::Unit::TestCase
315
327
  SCSS
316
328
  assert_correct css, <<-CSS
317
329
  .squares-sprite {
318
- background: url('/squares-sce5dc30797.png') no-repeat;
330
+ background-image: url('/squares-sce5dc30797.png');
331
+ background-repeat: no-repeat;
319
332
  }
320
333
 
321
334
  .adjusted-percentage {
@@ -353,7 +366,8 @@ class SpritesTest < Test::Unit::TestCase
353
366
  SCSS
354
367
  assert_correct css, <<-CSS
355
368
  .squares-sprite, .adjusted-percentage, .adjusted-px-1, .adjusted-px-2 {
356
- background: url('/squares-sce5dc30797.png') no-repeat;
369
+ background-image: url('/squares-sce5dc30797.png');
370
+ background-repeat: no-repeat;
357
371
  }
358
372
 
359
373
  .adjusted-percentage {
@@ -380,7 +394,8 @@ class SpritesTest < Test::Unit::TestCase
380
394
  SCSS
381
395
  assert_correct css, <<-CSS
382
396
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
383
- background: url('/squares-s65c43cd573.png') no-repeat;
397
+ background-image: url('/squares-s65c43cd573.png');
398
+ background-repeat: no-repeat;
384
399
  }
385
400
 
386
401
  .squares-ten-by-ten {
@@ -404,7 +419,8 @@ class SpritesTest < Test::Unit::TestCase
404
419
  SCSS
405
420
  assert_correct css, <<-CSS
406
421
  .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
407
- background: url('/squares-sb9d9a8ca6a.png') no-repeat;
422
+ background-image: url('/squares-sb9d9a8ca6a.png');
423
+ background-repeat: no-repeat;
408
424
  }
409
425
 
410
426
  .squares-ten-by-ten {
@@ -423,23 +439,19 @@ class SpritesTest < Test::Unit::TestCase
423
439
  assert_raise(Sass::SyntaxError) do
424
440
  render <<-SCSS
425
441
  .squares {
426
- background: sprite-url("squares/*.png") no-repeat;
427
- }
428
- SCSS
429
- end
430
- assert_raise(Sass::SyntaxError) do
431
- css = render <<-SCSS
432
- .squares {
433
- background: sprite-image("squares/twenty-by-twenty.png") no-repeat;
442
+ background-image: sprite-url("squares/*.png");
443
+ background-repeat: no-repeat;
434
444
  }
435
445
  SCSS
436
446
  end
447
+
437
448
  assert_raise(Sass::SyntaxError) do
438
449
  css = render <<-SCSS
439
450
  @import "squares/*.png";
440
451
 
441
452
  .squares {
442
- background: sprite-position("squares/twenty-by-twenty.png") no-repeat;
453
+ background-image: sprite-position("squares/twenty-by-twenty.png");
454
+ background-repeat: no-repeat;
443
455
  }
444
456
  SCSS
445
457
  end
@@ -448,12 +460,152 @@ class SpritesTest < Test::Unit::TestCase
448
460
  it "should work even if @import is missing" do
449
461
  css = render <<-SCSS
450
462
  .squares {
451
- background: sprite(sprite-map("squares/*.png"), twenty-by-twenty) no-repeat;
463
+ background-image: sprite(sprite-map("squares/*.png"), twenty-by-twenty);
464
+ background-repeat: no-repeat;
452
465
  }
453
466
  SCSS
454
467
  assert_correct css, <<-CSS
455
468
  .squares {
456
- background: url('/squares-sd817b59156.png') 0 -10px no-repeat;
469
+ background-image: url('/squares-sd817b59156.png') 0 -10px;
470
+ background-repeat: no-repeat;
471
+ }
472
+ CSS
473
+ end
474
+
475
+ it "should import sprites with numeric filenames via #738" do
476
+ css = render <<-SCSS
477
+ @import "numeric/*.png";
478
+ @include all-numeric-sprites;
479
+ SCSS
480
+ assert_correct css, <<-CSS
481
+ .numeric-sprite, .numeric-200 {
482
+ background-image: url('/numeric-saa92d65a89.png');
483
+ background-repeat: no-repeat;
484
+ }
485
+
486
+ .numeric-200 {
487
+ background-position: 0 0;
488
+ }
489
+ CSS
490
+ end
491
+
492
+ it "should use percentage positions when use_percentages is true" do
493
+ css = render <<-SCSS
494
+ @import "squares/*.png";
495
+ $squares-use-percentages: true;
496
+ .foo {
497
+ @include squares-sprite-position("twenty-by-twenty");
498
+ }
499
+ .bar {
500
+ @include squares-sprite-position("ten-by-ten");
501
+ @include squares-sprite-dimensions("ten-by-ten");
502
+ }
503
+ SCSS
504
+ assert_correct css, <<-CSS
505
+ .squares-sprite {
506
+ background-image: url('/squares-sbbc18e2129.png');
507
+ background-repeat: no-repeat;
508
+ }
509
+
510
+ .foo {
511
+ background-position: 0 100%;
512
+ }
513
+
514
+ .bar {
515
+ background-position: 0 0;
516
+ height: 10px;
517
+ width: 10px;
518
+ }
519
+ CSS
520
+ end
521
+
522
+ it "should use correct percentages when use_percentages is with horizontal layout" do
523
+ css = render <<-SCSS
524
+ $squares-layout: horizontal;
525
+ @import "squares/*.png";
526
+ $squares-use-percentages: true;
527
+ .foo {
528
+ @include squares-sprite-position("twenty-by-twenty");
529
+ }
530
+ .bar {
531
+ @include squares-sprite-position("ten-by-ten");
532
+ }
533
+ SCSS
534
+ assert_correct css, <<-CSS
535
+ .squares-sprite {
536
+ background-image: url('/squares-s4bd95c5c56.png');
537
+ background-repeat: no-repeat;
538
+ }
539
+
540
+ .foo {
541
+ background-position: 100% 0;
542
+ }
543
+
544
+ .bar {
545
+ background-position: 0 0;
546
+ }
547
+ CSS
548
+ end
549
+
550
+ it "should use correct percentages when use_percentages is true with smart layout" do
551
+ css = render <<-SCSS
552
+ $image_row-layout: smart;
553
+ @import "image_row/*.png";
554
+ $image_row-use-percentages: true;
555
+ .foo {
556
+ @include image_row-sprite-position("medium");
557
+ }
558
+ .bar {
559
+ @include image_row-sprite-position("large_square");
560
+ }
561
+ SCSS
562
+ assert_correct css, <<-CSS
563
+ .image_row-sprite {
564
+ background-image: url('/image_row-sc5082a6b9f.png');
565
+ background-repeat: no-repeat;
566
+ }
567
+
568
+ .foo {
569
+ background-position: 0 50%;
570
+ }
571
+
572
+ .bar {
573
+ background-position: 33.33333% 100%;
574
+ }
575
+ CSS
576
+ end
577
+
578
+ it "should use correct percentages when use_percentages is true" do
579
+ css = render <<-SCSS
580
+ $image_row-use-percentages: true;
581
+ $image_row-sort-by : '!width';
582
+ @import "image_row/*.png";
583
+ @include all-image_row-sprites;
584
+ SCSS
585
+ assert_correct css, <<-CSS
586
+ .image_row-sprite, .image_row-large, .image_row-large_square, .image_row-medium, .image_row-small, .image_row-tall {
587
+ background-image: url('/image_row-sdf383d45a3.png');
588
+ background-repeat: no-repeat;
589
+ }
590
+
591
+ .image_row-large {
592
+ background-position: 0 0;
593
+ }
594
+
595
+ .image_row-large_square {
596
+ background-position: 0 40%;
597
+ }
598
+
599
+ .image_row-medium {
600
+ background-position: 0 16.66667%;
601
+ }
602
+
603
+ .image_row-small {
604
+ background-position: 0 100%;
605
+ }
606
+
607
+ .image_row-tall {
608
+ background-position: 0 80%;
457
609
  }
458
610
  CSS
459
611
  end
@@ -472,7 +624,8 @@ class SpritesTest < Test::Unit::TestCase
472
624
  assert_equal image_size('squares-s*.png'), [20, 40]
473
625
  assert_correct css, <<-CSS
474
626
  .squares-sprite {
475
- background: url('/squares-s555875d730.png') no-repeat;
627
+ background-image: url('/squares-s555875d730.png');
628
+ background-repeat: no-repeat;
476
629
  }
477
630
 
478
631
  .foo {
@@ -492,19 +645,20 @@ class SpritesTest < Test::Unit::TestCase
492
645
  SCSS
493
646
  assert_correct css, <<-CSS
494
647
  .selectors-sprite, .selectors-ten-by-ten {
495
- background: url('/selectors-s7e84acb3d2.png') no-repeat;
648
+ background-image: url('/selectors-s7e84acb3d2.png');
649
+ background-repeat: no-repeat;
496
650
  }
497
651
 
498
652
  .selectors-ten-by-ten {
499
653
  background-position: 0 0;
500
654
  }
501
- .selectors-ten-by-ten:hover, .selectors-ten-by-ten.ten-by-ten_hover, .selectors-ten-by-ten.ten-by-ten-hover {
655
+ .selectors-ten-by-ten:hover, .selectors-ten-by-ten.ten-by-ten-hover {
502
656
  background-position: 0 -20px;
503
657
  }
504
- .selectors-ten-by-ten:target, .selectors-ten-by-ten.ten-by-ten_target, .selectors-ten-by-ten.ten-by-ten-target {
658
+ .selectors-ten-by-ten:target, .selectors-ten-by-ten.ten-by-ten-target {
505
659
  background-position: 0 -30px;
506
660
  }
507
- .selectors-ten-by-ten:active, .selectors-ten-by-ten.ten-by-ten_active, .selectors-ten-by-ten.ten-by-ten-active {
661
+ .selectors-ten-by-ten:active, .selectors-ten-by-ten.ten-by-ten-active {
508
662
  background-position: 0 -10px;
509
663
  }
510
664
  CSS
@@ -517,19 +671,20 @@ class SpritesTest < Test::Unit::TestCase
517
671
  SCSS
518
672
  assert_correct css, <<-CSS
519
673
  .selectors-sprite, .selectors-ten-by-ten {
520
- background: url('/selectors-s7e84acb3d2.png') no-repeat;
674
+ background-image: url('/selectors-s7e84acb3d2.png');
675
+ background-repeat: no-repeat;
521
676
  }
522
677
 
523
678
  .selectors-ten-by-ten {
524
679
  background-position: 20px 20px;
525
680
  }
526
- .selectors-ten-by-ten:hover, .selectors-ten-by-ten.ten-by-ten_hover, .selectors-ten-by-ten.ten-by-ten-hover {
681
+ .selectors-ten-by-ten:hover, .selectors-ten-by-ten.ten-by-ten-hover {
527
682
  background-position: 20px 0;
528
683
  }
529
- .selectors-ten-by-ten:target, .selectors-ten-by-ten.ten-by-ten_target, .selectors-ten-by-ten.ten-by-ten-target {
684
+ .selectors-ten-by-ten:target, .selectors-ten-by-ten.ten-by-ten-target {
530
685
  background-position: 20px -10px;
531
686
  }
532
- .selectors-ten-by-ten:active, .selectors-ten-by-ten.ten-by-ten_active, .selectors-ten-by-ten.ten-by-ten-active {
687
+ .selectors-ten-by-ten:active, .selectors-ten-by-ten.ten-by-ten-active {
533
688
  background-position: 20px 10px;
534
689
  }
535
690
  CSS
@@ -544,19 +699,20 @@ class SpritesTest < Test::Unit::TestCase
544
699
  SCSS
545
700
  assert_correct css, <<-CSS
546
701
  .selectors-sprite, a {
547
- background: url('/selectors-s7e84acb3d2.png') no-repeat;
702
+ background-image: url('/selectors-s7e84acb3d2.png');
703
+ background-repeat: no-repeat;
548
704
  }
549
705
 
550
706
  a {
551
707
  background-position: 0 0;
552
708
  }
553
- a:hover, a.ten-by-ten_hover, a.ten-by-ten-hover {
709
+ a:hover, a.ten-by-ten-hover {
554
710
  background-position: 0 -20px;
555
711
  }
556
- a:target, a.ten-by-ten_target, a.ten-by-ten-target {
712
+ a:target, a.ten-by-ten-target {
557
713
  background-position: 0 -30px;
558
714
  }
559
- a:active, a.ten-by-ten_active, a.ten-by-ten-active {
715
+ a:active, a.ten-by-ten-active {
560
716
  background-position: 0 -10px;
561
717
  }
562
718
  CSS
@@ -573,7 +729,8 @@ class SpritesTest < Test::Unit::TestCase
573
729
  SCSS
574
730
  assert_correct css, <<-CSS
575
731
  .selectors-sprite, a {
576
- background: url('/selectors-s7e84acb3d2.png') no-repeat;
732
+ background-image: url('/selectors-s7e84acb3d2.png');
733
+ background-repeat: no-repeat;
577
734
  }
578
735
 
579
736
  a {
@@ -591,33 +748,43 @@ class SpritesTest < Test::Unit::TestCase
591
748
  SCSS
592
749
  assert_correct css, <<-CSS
593
750
  .selectors-sprite, a {
594
- background: url('/selectors-s7e84acb3d2.png') no-repeat;
751
+ background-image: url('/selectors-s7e84acb3d2.png');
752
+ background-repeat: no-repeat;
595
753
  }
596
754
 
597
755
  a {
598
756
  background-position: 5px -5px;
599
757
  }
600
- a:hover, a.ten-by-ten_hover, a.ten-by-ten-hover {
758
+ a:hover, a.ten-by-ten-hover {
601
759
  background-position: 5px -25px;
602
760
  }
603
- a:target, a.ten-by-ten_target, a.ten-by-ten-target {
761
+ a:target, a.ten-by-ten-target {
604
762
  background-position: 5px -35px;
605
763
  }
606
- a:active, a.ten-by-ten_active, a.ten-by-ten-active {
764
+ a:active, a.ten-by-ten-active {
607
765
  background-position: 5px -15px;
608
766
  }
609
767
  CSS
610
768
  end
611
769
 
612
- it "should raise error on filenames that are not valid sass syntax" do
613
- assert_raise(Compass::Error) do
614
- css = render <<-SCSS
615
- @import "prefix/*.png";
616
- a {
617
- @include squares-sprite(20-by-20);
618
- }
619
- SCSS
620
- end
770
+ it "should not raise error on filenames that are invalid classnames if the selector generation is not used" do
771
+ css = render <<-SCSS
772
+ $prefix-sort-by : 'width';
773
+ @import "prefix/*.png";
774
+ a {
775
+ @include prefix-sprite("20-by-20");
776
+ }
777
+ SCSS
778
+ assert_correct <<-CSS, css
779
+ .prefix-sprite, a {
780
+ background-image: url('/prefix-s949dea513d.png');
781
+ background-repeat: no-repeat;
782
+ }
783
+
784
+ a {
785
+ background-position: 0 -10px;
786
+ }
787
+ CSS
621
788
  end
622
789
 
623
790
  it "should generate sprite with bad repeat-x dimensions" do
@@ -628,7 +795,8 @@ class SpritesTest < Test::Unit::TestCase
628
795
  SCSS
629
796
  assert_correct css, <<-CSS
630
797
  .ko-sprite, .ko-default_background, .ko-starbg26x27 {
631
- background: url('/ko-sd46dfbab4f.png') no-repeat;
798
+ background-image: url('/ko-sd46dfbab4f.png');
799
+ background-repeat: no-repeat;
632
800
  }
633
801
 
634
802
  .ko-default_background {
@@ -699,7 +867,8 @@ class SpritesTest < Test::Unit::TestCase
699
867
  SCSS
700
868
  assert_correct css, <<-CSS
701
869
  .nested-sprite, .nested-ten-by-ten {
702
- background: url('/nested-s7b93e0b6bf.png') no-repeat;
870
+ background-image: url('/nested-s7b93e0b6bf.png');
871
+ background-repeat: no-repeat;
703
872
  }
704
873
 
705
874
  .nested-ten-by-ten {
@@ -722,7 +891,8 @@ class SpritesTest < Test::Unit::TestCase
722
891
  assert_equal [30, 20], image_size('squares-s*.png')
723
892
  other_css = <<-CSS
724
893
  .squares-sprite {
725
- background: url('/squares-s4bd95c5c56.png') no-repeat;
894
+ background-image: url('/squares-s4bd95c5c56.png');
895
+ background-repeat: no-repeat;
726
896
  }
727
897
 
728
898
  .foo {
@@ -748,7 +918,8 @@ class SpritesTest < Test::Unit::TestCase
748
918
  SCSS
749
919
  other_css = <<-CSS
750
920
  .squares-sprite {
751
- background: url('/squares-sbbc18e2129.png') no-repeat;
921
+ background-image: url('/squares-sbbc18e2129.png');
922
+ background-repeat: no-repeat;
752
923
  }
753
924
  .div {
754
925
  height:21px;
@@ -769,8 +940,9 @@ class SpritesTest < Test::Unit::TestCase
769
940
  }
770
941
  SCSS
771
942
  other_css = <<-CSS
772
- .colors-sprite {
773
- background:url('/colors-s58671cb5bb.png') no-repeat;
943
+ .colors-sprite {
944
+ background-image:url('/colors-s58671cb5bb.png');
945
+ background-repeat: no-repeat;
774
946
  }
775
947
  .blue {
776
948
  text-indent:-119988px;
@@ -796,7 +968,14 @@ class SpritesTest < Test::Unit::TestCase
796
968
  end
797
969
 
798
970
  it "should inline the sprite file" do
799
- css = render <<-SCSS
971
+ Compass.reset_configuration!
972
+ file = StringIO.new(<<-CONFIG)
973
+ images_path = #{@images_tmp_path.inspect}
974
+ generated_images_path = #{@generated_images_tmp_path.inspect}
975
+ CONFIG
976
+ Compass.add_configuration(file, "sprite_config")
977
+ Compass.configure_sass_plugin!
978
+ css = render <<-SCSS
800
979
  $colors-inline:true;
801
980
  @import "colors/*.png";
802
981
  @include all-colors-sprites;
@@ -817,7 +996,6 @@ class SpritesTest < Test::Unit::TestCase
817
996
 
818
997
  it "should have a sprite_name function that returns the names of the sprites in a sass list" do
819
998
  css = render <<-SCSS
820
- $colors-inline:true;
821
999
  @import "colors/*.png";
822
1000
  @each $color in sprite_names($colors-sprites) {
823
1001
  .\#{$color} {
@@ -827,7 +1005,8 @@ class SpritesTest < Test::Unit::TestCase
827
1005
  SCSS
828
1006
  other_css = <<-CSS
829
1007
  .colors-sprite {
830
- background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAUCAAAAACRhfOKAAAAHElEQVR42mM5wQADLP8JMRlIUIvE/IdgctLTNgCHDhEQVD4ceAAAAABJRU5ErkJggg==');
1008
+ background-image: url('/colors-s58671cb5bb.png');
1009
+ background-repeat: no-repeat;
831
1010
  }
832
1011
  .blue {
833
1012
  width:0px;
@@ -840,4 +1019,67 @@ class SpritesTest < Test::Unit::TestCase
840
1019
 
841
1020
  end
842
1021
 
1022
+ it "should respect global spacing" do
1023
+ css = render <<-SCSS
1024
+ $colors-spacing:5px;
1025
+ @import "colors/*.png";
1026
+ @include all-colors-sprites;
1027
+ SCSS
1028
+ other_css = <<-CSS
1029
+ .colors-sprite, .colors-blue, .colors-yellow {
1030
+ background-image: url('/colors-s747dec274e.png');
1031
+ background-repeat: no-repeat;
1032
+ }
1033
+ .colors-blue {
1034
+ background-position:0 0;
1035
+ }
1036
+ .colors-yellow {
1037
+ background-position:0 -15px;
1038
+ }
1039
+ CSS
1040
+ assert_correct clean(css), clean(other_css)
1041
+ end
1042
+
1043
+ it "should return width and height of the map" do
1044
+ css = render <<-SCSS
1045
+ @import "colors/*.png";
1046
+ .height { height : sprite_height($colors-sprites); }
1047
+ .width { width : sprite_width($colors-sprites); }
1048
+ SCSS
1049
+ other_css = <<-CSS
1050
+ .colors-sprite {
1051
+ background-image: url('/colors-s58671cb5bb.png');
1052
+ background-repeat: no-repeat;
1053
+ }
1054
+ .height {
1055
+ height : 20px;
1056
+ }
1057
+ .width {
1058
+ width : 10px;
1059
+ }
1060
+ CSS
1061
+ assert_correct clean(css), clean(other_css)
1062
+ end
1063
+
1064
+ it "should return width and height of a sprite" do
1065
+ css = render <<-SCSS
1066
+ @import "colors/*.png";
1067
+ .height { height : sprite_height($colors-sprites, blue); }
1068
+ .width { width : sprite_width($colors-sprites, blue); }
1069
+ SCSS
1070
+ other_css = <<-CSS
1071
+ .colors-sprite {
1072
+ background-image: url('/colors-s58671cb5bb.png');
1073
+ background-repeat: no-repeat;
1074
+ }
1075
+ .height {
1076
+ height : 10px;
1077
+ }
1078
+ .width {
1079
+ width : 10px;
1080
+ }
1081
+ CSS
1082
+ assert_correct clean(css), clean(other_css)
1083
+ end
1084
+
843
1085
  end
data/test/test_helper.rb CHANGED
@@ -5,23 +5,9 @@ $:.unshift(lib_dir) unless $:.include?(lib_dir)
5
5
  test_dir = File.dirname(__FILE__)
6
6
  $:.unshift(test_dir) unless $:.include?(test_dir)
7
7
 
8
- # allows testing with edge Haml by creating a test/haml symlink
9
- linked_haml = File.dirname(__FILE__) + '/haml'
10
-
11
- if File.exists?(linked_haml) && !$:.include?(linked_haml + '/lib')
12
- puts "[ using linked Haml ]"
13
- $:.unshift linked_haml + '/lib'
14
- require 'sass'
15
- else
16
- need_gems = true
17
- end
18
-
19
- require 'rubygems' if need_gems
20
-
21
8
  require 'compass'
22
9
 
23
10
  require 'test/unit'
24
- require "mocha/test_unit"
25
11
 
26
12
 
27
13
  class String
@@ -41,6 +27,10 @@ class Test::Unit::TestCase
41
27
  include Compass::IoHelper
42
28
  extend Compass::TestCaseHelper::ClassMethods
43
29
 
30
+ def fixture_path
31
+ File.join(File.expand_path('../', __FILE__), 'fixtures')
32
+ end
33
+
44
34
  end
45
35
 
46
36
  module SpriteHelper
@@ -72,4 +62,4 @@ module SpriteHelper
72
62
  rescue Errno::ENOENT => e
73
63
  end
74
64
 
75
- end
65
+ end
@@ -22,10 +22,8 @@ class CommandLineTest < Test::Unit::TestCase
22
22
  within_tmp_directory do
23
23
  compass "create", "--boring", "basic"
24
24
  assert File.exists?("basic/sass/screen.scss")
25
- assert File.exists?("basic/stylesheets/screen.css")
26
25
  assert_action_performed :directory, "basic/"
27
26
  assert_action_performed :create, "basic/sass/screen.scss"
28
- assert_action_performed :create, "basic/stylesheets/screen.css"
29
27
  end
30
28
  end
31
29