compass 0.11.2 → 0.11.3
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.
- data/VERSION.yml +1 -1
- data/features/command_line.feature +22 -1
- data/features/step_definitions/command_line_steps.rb +21 -1
- data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +1 -0
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +9 -9
- data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +4 -14
- data/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +14 -1
- data/lib/compass.rbc +87 -11
- data/lib/compass/actions.rb +21 -9
- data/lib/compass/actions.rbc +453 -210
- data/lib/compass/commands.rb +1 -1
- data/lib/compass/commands/clean_project.rb +79 -0
- data/lib/compass/commands/registry.rb +3 -1
- data/lib/compass/commands/sprite.rb +1 -1
- data/lib/compass/commands/update_project.rb +5 -6
- data/lib/compass/commands/watch_project.rb +1 -1
- data/lib/compass/compiler.rb +12 -9
- data/lib/compass/compiler.rbc +386 -294
- data/lib/compass/configuration/adapters.rb +2 -2
- data/lib/compass/configuration/adapters.rbc +4 -4
- data/lib/compass/configuration/data.rb +4 -2
- data/lib/compass/exec/sub_command_ui.rb +1 -1
- data/lib/compass/sass_extensions.rbc +117 -19
- data/lib/compass/sass_extensions/functions/gradient_support.rbc +489 -453
- data/lib/compass/sass_extensions/functions/sprites.rb +4 -4
- data/lib/compass/sass_extensions/functions/sprites.rbc +588 -309
- data/lib/compass/sass_extensions/functions/urls.rb +18 -3
- data/lib/compass/sass_extensions/sprites.rb +9 -7
- data/lib/compass/sass_extensions/sprites.rbc +48 -64
- data/lib/compass/sass_extensions/sprites/engines.rb +24 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +13 -7
- data/lib/compass/sass_extensions/sprites/image_methods.rb +32 -0
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +54 -142
- data/lib/compass/sass_extensions/sprites/sprite_map.rbc +3839 -1536
- data/lib/compass/sass_extensions/sprites/{base.rb → sprite_methods.rb} +21 -101
- data/lib/compass/sprite_importer.rb +202 -0
- data/lib/compass/sprite_importer.rbc +3943 -0
- data/lib/compass/validator.rb +11 -4
- data/lib/compass/version.rbc +67 -109
- data/test/fixtures/sprites/public/images/bad_extensions/ten-by-ten.gif +0 -0
- data/test/fixtures/sprites/public/images/bad_extensions/twenty-by-twenty.jpg +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/config.rb +29 -0
- data/test/fixtures/stylesheets/busted_image_urls/css/screen.css +9 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/feed.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/flags/dk.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/sass/screen.sass +14 -0
- data/test/fixtures/stylesheets/busted_image_urls/tmp/screen.css +9 -0
- data/test/fixtures/stylesheets/compass/css/box.css +19 -0
- data/test/fixtures/stylesheets/compass/css/legacy_clearfix.css +9 -0
- data/test/fixtures/stylesheets/compass/css/sprites.css +1 -1
- data/test/fixtures/stylesheets/compass/css/utilities.css +7 -0
- data/test/fixtures/stylesheets/compass/images/{flag-03c3b29b35.png → flag-s03c3b29b35.png} +0 -0
- data/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +4 -1
- data/test/fixtures/stylesheets/error/config.rb +10 -0
- data/test/fixtures/stylesheets/error/sass/screen.sass +2 -0
- data/test/integrations/compass_test.rb +22 -9
- data/test/integrations/sprites_test.rb +45 -45
- data/test/units/actions_test.rb +24 -0
- data/test/units/sprites/engine_test.rb +43 -0
- data/test/units/sprites/image_test.rb +2 -2
- data/test/units/sprites/importer_test.rb +66 -0
- data/test/units/sprites/sprite_command_test.rb +60 -0
- data/test/units/sprites/{base_test.rb → sprite_map_test.rb} +5 -5
- metadata +43 -34
- data/lib/compass/sass_extensions/sprites/sprites.rb +0 -62
@@ -1,5 +1,5 @@
|
|
1
1
|
.flag-sprite, #flags .us, #flags .au, #flags .ca, #flags .es, #flags .eg, #flags .ly, .flag-ad, .flag-ae, .flag-af, .flag-ag, .flag-ai, .flag-al, .flag-am, .flag-an, .flag-ao, .flag-ar, .flag-as, .flag-at, .flag-au, .flag-aw, .flag-ax, .flag-az, .flag-ba, .flag-bb, .flag-bd, .flag-be, .flag-bf, .flag-bg, .flag-bh, .flag-bi, .flag-bj, .flag-bm, .flag-bn, .flag-bo, .flag-br, .flag-bs, .flag-bt, .flag-bv, .flag-bw, .flag-by, .flag-bz, .flag-ca, .flag-catalonia, .flag-cc, .flag-cd, .flag-cf, .flag-cg, .flag-ch, .flag-ci, .flag-ck, .flag-cl, .flag-cm, .flag-cn, .flag-co, .flag-cr, .flag-cs, .flag-cu, .flag-cv, .flag-cx, .flag-cy, .flag-cz, .flag-de, .flag-dj, .flag-dk, .flag-dm, .flag-do, .flag-dz, .flag-ec, .flag-ee, .flag-eg, .flag-eh, .flag-england, .flag-er, .flag-es, .flag-et, .flag-europeanunion, .flag-fam, .flag-fi, .flag-fj, .flag-fk, .flag-fm, .flag-fo, .flag-fr, .flag-ga, .flag-gb, .flag-gd, .flag-ge, .flag-gf, .flag-gh, .flag-gi, .flag-gl, .flag-gm, .flag-gn, .flag-gp, .flag-gq, .flag-gr, .flag-gs, .flag-gt, .flag-gu, .flag-gw, .flag-gy, .flag-hk, .flag-hm, .flag-hn, .flag-hr, .flag-ht, .flag-hu, .flag-id-2, .flag-ie, .flag-il, .flag-in, .flag-io, .flag-iq, .flag-ir, .flag-is, .flag-it, .flag-jm, .flag-jo, .flag-jp, .flag-ke, .flag-kg, .flag-kh, .flag-ki, .flag-km, .flag-kn, .flag-kp, .flag-kr, .flag-kw, .flag-ky, .flag-kz, .flag-la, .flag-lb, .flag-lc, .flag-li, .flag-lk, .flag-lr, .flag-ls, .flag-lt, .flag-lu, .flag-lv, .flag-ly, .flag-ma, .flag-mc, .flag-md, .flag-me, .flag-mg, .flag-mh, .flag-mk, .flag-ml, .flag-mm, .flag-mn, .flag-mo, .flag-mp, .flag-mq, .flag-mr, .flag-ms, .flag-mt, .flag-mu, .flag-mv, .flag-mw, .flag-mx, .flag-my, .flag-mz, .flag-na, .flag-nc, .flag-ne, .flag-nf, .flag-ng, .flag-ni, .flag-nl, .flag-no, .flag-np, .flag-nr, .flag-nu, .flag-nz, .flag-om, .flag-pa, .flag-pe, .flag-pf, .flag-pg, .flag-ph, .flag-pk, .flag-pl, .flag-pm, .flag-pn, .flag-pr, .flag-ps, .flag-pt, .flag-pw, .flag-py, .flag-qa, .flag-re, .flag-ro, .flag-rs, .flag-ru, .flag-rw, .flag-sa, .flag-sb, .flag-sc, .flag-scotland, .flag-sd, .flag-se, .flag-sg, .flag-sh, .flag-si, .flag-sj, .flag-sk, .flag-sl, .flag-sm, .flag-sn, .flag-so, .flag-sr, .flag-st, .flag-sv, .flag-sy, .flag-sz, .flag-tc, .flag-td, .flag-tf, .flag-tg, .flag-th, .flag-tj, .flag-tk, .flag-tl, .flag-tm, .flag-tn, .flag-to, .flag-tr, .flag-tt, .flag-tv, .flag-tw, .flag-tz, .flag-ua, .flag-ug, .flag-um, .flag-us, .flag-uy, .flag-uz, .flag-va, .flag-vc, .flag-ve, .flag-vg, .flag-vi, .flag-vn, .flag-vu, .flag-wales, .flag-wf, .flag-ws, .flag-ye, .flag-yt, .flag-za, .flag-zm, .flag-zw {
|
2
|
-
background: url('/images/flag-
|
2
|
+
background: url('/images/flag-s03c3b29b35.png') no-repeat; }
|
3
3
|
|
4
4
|
#flags .us {
|
5
5
|
background-position: 0 -2520px;
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Require any additional compass plugins here.
|
2
|
+
css_dir = "tmp"
|
3
|
+
sass_dir = "sass"
|
4
|
+
images_dir = "assets/images"
|
5
|
+
javascripts_dir = "assets/javascripts"
|
6
|
+
# Set this to the root of your project when deployed:
|
7
|
+
http_path = "/"
|
8
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
9
|
+
output_style = :compact
|
10
|
+
relative_assets = true
|
@@ -30,14 +30,16 @@ class CompassTest < Test::Unit::TestCase
|
|
30
30
|
|
31
31
|
# no project with errors exists to test aginst - leep of FAITH!
|
32
32
|
# *chriseppstein flogs himself*
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
33
|
+
def test_on_stylesheet_error_callback
|
34
|
+
error = false
|
35
|
+
file = nil
|
36
|
+
before_compile = Proc.new do |config|
|
37
|
+
config.on_stylesheet_error {|filename, message| file = filename; error = true }
|
38
|
+
end
|
39
|
+
within_project(:error, before_compile) rescue nil;
|
40
|
+
assert error, "Project did not throw a compile error"
|
41
|
+
assert file.is_a?(String), "Filename was not a string"
|
42
|
+
end
|
41
43
|
|
42
44
|
def test_empty_project
|
43
45
|
# With no sass files, we should have no css files.
|
@@ -55,7 +57,7 @@ class CompassTest < Test::Unit::TestCase
|
|
55
57
|
assert_no_errors css_file, :blueprint
|
56
58
|
end
|
57
59
|
each_sass_file do |sass_file|
|
58
|
-
assert_renders_correctly sass_file
|
60
|
+
assert_renders_correctly sass_file, :ignore_charset => true
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
@@ -71,6 +73,17 @@ class CompassTest < Test::Unit::TestCase
|
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
76
|
+
def test_busted_image_urls
|
77
|
+
within_project('busted_image_urls') do |proj|
|
78
|
+
each_css_file(proj.css_path) do |css_file|
|
79
|
+
assert_no_errors css_file, 'busted_image_urls'
|
80
|
+
end
|
81
|
+
each_sass_file do |sass_file|
|
82
|
+
assert_renders_correctly sass_file
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
74
87
|
def test_image_urls
|
75
88
|
within_project('image_urls') do |proj|
|
76
89
|
each_css_file(proj.css_path) do |css_file|
|
@@ -59,7 +59,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
59
59
|
SCSS
|
60
60
|
assert_correct css, <<-CSS
|
61
61
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
62
|
-
background: url('/squares-
|
62
|
+
background: url('/squares-s161c60ad78.png') no-repeat;
|
63
63
|
}
|
64
64
|
|
65
65
|
.squares-ten-by-ten {
|
@@ -70,8 +70,8 @@ class SpritesTest < Test::Unit::TestCase
|
|
70
70
|
background-position: 0 -10px;
|
71
71
|
}
|
72
72
|
CSS
|
73
|
-
assert_equal image_size('squares
|
74
|
-
assert_equal image_md5('squares
|
73
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
74
|
+
assert_equal image_md5('squares-s*.png'), '7349a0f4e88ea80abddcf6ac2486abe3'
|
75
75
|
end
|
76
76
|
|
77
77
|
it "should generate sprite classes with dimensions" do
|
@@ -82,7 +82,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
82
82
|
SCSS
|
83
83
|
assert_correct css, <<-CSS
|
84
84
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
85
|
-
background: url('/squares-
|
85
|
+
background: url('/squares-s161c60ad78.png') no-repeat;
|
86
86
|
}
|
87
87
|
|
88
88
|
.squares-ten-by-ten {
|
@@ -97,7 +97,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
97
97
|
width: 20px;
|
98
98
|
}
|
99
99
|
CSS
|
100
|
-
assert_equal image_size('squares
|
100
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
101
101
|
end
|
102
102
|
|
103
103
|
it "should provide sprite mixin" do
|
@@ -114,7 +114,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
114
114
|
SCSS
|
115
115
|
assert_correct css, <<-CSS
|
116
116
|
.squares-sprite, .cubicle, .large-cube {
|
117
|
-
background: url('/squares-
|
117
|
+
background: url('/squares-s161c60ad78.png') no-repeat;
|
118
118
|
}
|
119
119
|
|
120
120
|
.cubicle {
|
@@ -127,7 +127,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
127
127
|
width: 20px;
|
128
128
|
}
|
129
129
|
CSS
|
130
|
-
assert_equal image_size('squares
|
130
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
131
131
|
end
|
132
132
|
|
133
133
|
# CUSTOMIZATIONS:
|
@@ -139,10 +139,10 @@ class SpritesTest < Test::Unit::TestCase
|
|
139
139
|
SCSS
|
140
140
|
assert_correct css, <<-CSS
|
141
141
|
.circles {
|
142
|
-
background: url('/squares-
|
142
|
+
background: url('/squares-s161c60ad78.png') no-repeat;
|
143
143
|
}
|
144
144
|
CSS
|
145
|
-
assert_equal image_size('squares
|
145
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
146
146
|
end
|
147
147
|
|
148
148
|
it "should calculate the spacing between images but not before first image" do
|
@@ -153,7 +153,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
153
153
|
SCSS
|
154
154
|
assert_correct css, <<-CSS
|
155
155
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
156
|
-
background: url('/squares-
|
156
|
+
background: url('/squares-s89450808af.png') no-repeat;
|
157
157
|
}
|
158
158
|
|
159
159
|
.squares-ten-by-ten {
|
@@ -164,7 +164,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
164
164
|
background-position: 0 -43px;
|
165
165
|
}
|
166
166
|
CSS
|
167
|
-
assert_equal image_size('squares
|
167
|
+
assert_equal image_size('squares-s*.png'), [20, 63]
|
168
168
|
end
|
169
169
|
|
170
170
|
it "should calculate the spacing between images" do
|
@@ -175,7 +175,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
175
175
|
SCSS
|
176
176
|
assert_correct css, <<-CSS
|
177
177
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
178
|
-
background: url('/squares-
|
178
|
+
background: url('/squares-s673837183a.png') no-repeat;
|
179
179
|
}
|
180
180
|
|
181
181
|
.squares-ten-by-ten {
|
@@ -186,7 +186,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
186
186
|
background-position: 0 -43px;
|
187
187
|
}
|
188
188
|
CSS
|
189
|
-
assert_equal image_size('squares
|
189
|
+
assert_equal image_size('squares-s*.png'), [20, 63]
|
190
190
|
end
|
191
191
|
|
192
192
|
it "should calculate the maximum spacing between images" do
|
@@ -198,7 +198,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
198
198
|
SCSS
|
199
199
|
assert_correct css, <<-CSS
|
200
200
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
201
|
-
background: url('/squares-
|
201
|
+
background: url('/squares-s1cd84c9068.png') no-repeat;
|
202
202
|
}
|
203
203
|
|
204
204
|
.squares-ten-by-ten {
|
@@ -209,7 +209,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
209
209
|
background-position: 0 -54px;
|
210
210
|
}
|
211
211
|
CSS
|
212
|
-
assert_equal image_size('squares
|
212
|
+
assert_equal image_size('squares-s*.png'), [20, 74]
|
213
213
|
end
|
214
214
|
|
215
215
|
it "should calculate the maximum spacing between images in reversed order" do
|
@@ -221,7 +221,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
221
221
|
SCSS
|
222
222
|
assert_correct css, <<-CSS
|
223
223
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
224
|
-
background: url('/squares-
|
224
|
+
background: url('/squares-sf25b7090ca.png') no-repeat;
|
225
225
|
}
|
226
226
|
|
227
227
|
.squares-ten-by-ten {
|
@@ -232,7 +232,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
232
232
|
background-position: 0 -54px;
|
233
233
|
}
|
234
234
|
CSS
|
235
|
-
assert_equal image_size('squares
|
235
|
+
assert_equal image_size('squares-s*.png'), [20, 74]
|
236
236
|
end
|
237
237
|
|
238
238
|
it "should calculate the default spacing between images" do
|
@@ -243,7 +243,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
243
243
|
SCSS
|
244
244
|
assert_correct css, <<-CSS
|
245
245
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
246
|
-
background: url('/squares-
|
246
|
+
background: url('/squares-sd66bf24bab.png') no-repeat;
|
247
247
|
}
|
248
248
|
|
249
249
|
.squares-ten-by-ten {
|
@@ -254,7 +254,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
254
254
|
background-position: 0 -32px;
|
255
255
|
}
|
256
256
|
CSS
|
257
|
-
assert_equal image_size('squares
|
257
|
+
assert_equal image_size('squares-s*.png'), [20, 52]
|
258
258
|
end
|
259
259
|
|
260
260
|
it "should use position adjustments in functions" do
|
@@ -278,7 +278,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
278
278
|
SCSS
|
279
279
|
assert_correct css, <<-CSS
|
280
280
|
.squares-sprite {
|
281
|
-
background: url('/squares-
|
281
|
+
background: url('/squares-s8e490168dd.png') no-repeat;
|
282
282
|
}
|
283
283
|
|
284
284
|
.adjusted-percentage {
|
@@ -293,8 +293,8 @@ class SpritesTest < Test::Unit::TestCase
|
|
293
293
|
background-position: -3px -8px;
|
294
294
|
}
|
295
295
|
CSS
|
296
|
-
assert_equal image_size('squares
|
297
|
-
assert_equal image_md5('squares
|
296
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
297
|
+
assert_equal image_md5('squares-s*.png'), '9cc7ce48cfaf304381c2d08adefd2fb6'
|
298
298
|
end
|
299
299
|
|
300
300
|
it "should use position adjustments in mixins" do
|
@@ -316,7 +316,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
316
316
|
SCSS
|
317
317
|
assert_correct css, <<-CSS
|
318
318
|
.squares-sprite, .adjusted-percentage, .adjusted-px-1, .adjusted-px-2 {
|
319
|
-
background: url('/squares-
|
319
|
+
background: url('/squares-s8e490168dd.png') no-repeat;
|
320
320
|
}
|
321
321
|
|
322
322
|
.adjusted-percentage {
|
@@ -331,8 +331,8 @@ class SpritesTest < Test::Unit::TestCase
|
|
331
331
|
background-position: -3px -8px;
|
332
332
|
}
|
333
333
|
CSS
|
334
|
-
assert_equal image_size('squares
|
335
|
-
assert_equal image_md5('squares
|
334
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
335
|
+
assert_equal image_md5('squares-s*.png'), '9cc7ce48cfaf304381c2d08adefd2fb6'
|
336
336
|
end
|
337
337
|
|
338
338
|
it "should repeat the image" do
|
@@ -343,7 +343,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
343
343
|
SCSS
|
344
344
|
assert_correct css, <<-CSS
|
345
345
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
346
|
-
background: url('/squares-
|
346
|
+
background: url('/squares-sa5550fd132.png') no-repeat;
|
347
347
|
}
|
348
348
|
|
349
349
|
.squares-ten-by-ten {
|
@@ -354,8 +354,8 @@ class SpritesTest < Test::Unit::TestCase
|
|
354
354
|
background-position: 0 -10px;
|
355
355
|
}
|
356
356
|
CSS
|
357
|
-
assert_equal image_size('squares
|
358
|
-
assert_equal image_md5('squares
|
357
|
+
assert_equal image_size('squares-s*.png'), [20, 30]
|
358
|
+
assert_equal image_md5('squares-s*.png'), 'a77a2fd43f04d791722b706aa7c9f1c1'
|
359
359
|
end
|
360
360
|
|
361
361
|
it "should allow the position of a sprite to be specified in absolute pixels" do
|
@@ -367,7 +367,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
367
367
|
SCSS
|
368
368
|
assert_correct css, <<-CSS
|
369
369
|
.squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty {
|
370
|
-
background: url('/squares-
|
370
|
+
background: url('/squares-s89a274044e.png') no-repeat;
|
371
371
|
}
|
372
372
|
|
373
373
|
.squares-ten-by-ten {
|
@@ -378,8 +378,8 @@ class SpritesTest < Test::Unit::TestCase
|
|
378
378
|
background-position: -10px -10px;
|
379
379
|
}
|
380
380
|
CSS
|
381
|
-
assert_equal image_size('squares
|
382
|
-
assert_equal image_md5('squares
|
381
|
+
assert_equal image_size('squares-s*.png'), [30, 30]
|
382
|
+
assert_equal image_md5('squares-s*.png'), '9856ced9e8211b6b28ff782019a0d905'
|
383
383
|
end
|
384
384
|
|
385
385
|
it "should provide a nice errors for lemonade's old users" do
|
@@ -416,7 +416,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
416
416
|
SCSS
|
417
417
|
assert_correct css, <<-CSS
|
418
418
|
.squares {
|
419
|
-
background: url('/squares-
|
419
|
+
background: url('/squares-s145869726f.png') 0 -10px no-repeat;
|
420
420
|
}
|
421
421
|
CSS
|
422
422
|
end
|
@@ -432,10 +432,10 @@ class SpritesTest < Test::Unit::TestCase
|
|
432
432
|
@include sprite-background-position($squares-sprites, "ten-by-ten");
|
433
433
|
}
|
434
434
|
SCSS
|
435
|
-
assert_equal image_size('squares
|
435
|
+
assert_equal image_size('squares-s*.png'), [20, 40]
|
436
436
|
assert_correct css, <<-CSS
|
437
437
|
.squares-sprite {
|
438
|
-
background: url('/squares-
|
438
|
+
background: url('/squares-se3c68372d9.png') no-repeat;
|
439
439
|
}
|
440
440
|
|
441
441
|
.foo {
|
@@ -455,7 +455,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
455
455
|
SCSS
|
456
456
|
assert_correct css, <<-CSS
|
457
457
|
.selectors-sprite, .selectors-ten-by-ten {
|
458
|
-
background: url('/selectors-
|
458
|
+
background: url('/selectors-sedfef809e2.png') no-repeat;
|
459
459
|
}
|
460
460
|
|
461
461
|
.selectors-ten-by-ten {
|
@@ -482,7 +482,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
482
482
|
SCSS
|
483
483
|
assert_correct css, <<-CSS
|
484
484
|
.selectors-sprite, a {
|
485
|
-
background: url('/selectors-
|
485
|
+
background: url('/selectors-sedfef809e2.png') no-repeat;
|
486
486
|
}
|
487
487
|
|
488
488
|
a {
|
@@ -510,7 +510,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
510
510
|
SCSS
|
511
511
|
assert_correct css, <<-CSS
|
512
512
|
.selectors-sprite, a {
|
513
|
-
background: url('/selectors-
|
513
|
+
background: url('/selectors-sedfef809e2.png') no-repeat;
|
514
514
|
}
|
515
515
|
|
516
516
|
a {
|
@@ -538,7 +538,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
538
538
|
SCSS
|
539
539
|
assert_correct css, <<-CSS
|
540
540
|
.ko-sprite, .ko-default_background, .ko-starbg26x27 {
|
541
|
-
background: url('/ko-
|
541
|
+
background: url('/ko-scc3f80660d.png') no-repeat;
|
542
542
|
}
|
543
543
|
|
544
544
|
.ko-default_background {
|
@@ -552,8 +552,8 @@ class SpritesTest < Test::Unit::TestCase
|
|
552
552
|
end
|
553
553
|
|
554
554
|
it "should generate a sprite and remove the old file" do
|
555
|
-
FileUtils.touch File.join(@images_tmp_path, "selectors-
|
556
|
-
assert_equal 1, map_files('selectors
|
555
|
+
FileUtils.touch File.join(@images_tmp_path, "selectors-scc8834Fdd.png")
|
556
|
+
assert_equal 1, map_files('selectors-s*.png').size
|
557
557
|
css = render <<-SCSS
|
558
558
|
@import "selectors/*.png";
|
559
559
|
a {
|
@@ -561,12 +561,12 @@ class SpritesTest < Test::Unit::TestCase
|
|
561
561
|
@include selectors-sprite(ten-by-ten)
|
562
562
|
}
|
563
563
|
SCSS
|
564
|
-
assert_equal 1, map_files('selectors
|
564
|
+
assert_equal 1, map_files('selectors-s*.png').size, "File was not removed"
|
565
565
|
end
|
566
566
|
|
567
567
|
it "should generate a sprite and NOT remove the old file" do
|
568
|
-
FileUtils.touch File.join(@images_tmp_path, "selectors-
|
569
|
-
assert_equal 1, map_files('selectors
|
568
|
+
FileUtils.touch File.join(@images_tmp_path, "selectors-scc8834Ftest.png")
|
569
|
+
assert_equal 1, map_files('selectors-s*.png').size
|
570
570
|
css = render <<-SCSS
|
571
571
|
$selectors-clean-up: false;
|
572
572
|
@import "selectors/*.png";
|
@@ -575,7 +575,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
575
575
|
@include selectors-sprite(ten-by-ten)
|
576
576
|
}
|
577
577
|
SCSS
|
578
|
-
assert_equal 2, map_files('selectors
|
578
|
+
assert_equal 2, map_files('selectors-s*.png').size, "File was removed"
|
579
579
|
end
|
580
580
|
|
581
581
|
it "should generate a sprite if the sprite is a colorname" do
|
@@ -595,7 +595,7 @@ class SpritesTest < Test::Unit::TestCase
|
|
595
595
|
SCSS
|
596
596
|
assert_correct css, <<-CSS
|
597
597
|
.nested-sprite, .nested-ten-by-ten {
|
598
|
-
background: url('/nested-
|
598
|
+
background: url('/nested-s55a8935544.png') no-repeat;
|
599
599
|
}
|
600
600
|
|
601
601
|
.nested-ten-by-ten {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'compass'
|
3
|
+
|
4
|
+
class ActionsTest < Test::Unit::TestCase
|
5
|
+
class BaseActionExtender
|
6
|
+
include Compass::Actions
|
7
|
+
def options
|
8
|
+
@@options ||= {}
|
9
|
+
end
|
10
|
+
def working_path
|
11
|
+
"/tmp"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# When log4r is included, it sometimes breaks the Actions
|
16
|
+
def test_quiet_option
|
17
|
+
b = BaseActionExtender.new
|
18
|
+
b.logger = ""
|
19
|
+
b.options[:quiet] = true
|
20
|
+
|
21
|
+
# logger shouldn't be called... if it is, this will error
|
22
|
+
b.directory("/tmp/#{(rand * 1000000).to_i}")
|
23
|
+
end
|
24
|
+
end
|