diff --git a/test/fixtures/stylesheets/compass/css/sprites.css b/test/fixtures/stylesheets/compass/css/sprites.css index 3fc49c14..a7461fa8 100644 --- a/test/fixtures/stylesheets/compass/css/sprites.css +++ b/test/fixtures/stylesheets/compass/css/sprites.css @@ -1,5 +1,5 @@ .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 { - background: url('/images/flag-s8c3c755a68.png') no-repeat; } + background: url('/images/flag-s8f1e8fdb9b.png') no-repeat; } #flags .us { background-position: 0 -407px; diff --git a/test/fixtures/stylesheets/compass/images/flag-s8c3c755a68.png b/test/fixtures/stylesheets/compass/images/flag-s8f1e8fdb9b.png similarity index 100% rename from test/fixtures/stylesheets/compass/images/flag-s8c3c755a68.png rename to test/fixtures/stylesheets/compass/images/flag-s8f1e8fdb9b.png diff --git a/test/integrations/sprites_test.rb b/test/integrations/sprites_test.rb index fa865e95..a447b3c6 100644 --- a/test/integrations/sprites_test.rb +++ b/test/integrations/sprites_test.rb @@ -63,7 +63,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-s161c60ad78.png') no-repeat; + background: url('/squares-sbbc18e2129.png') no-repeat; } .squares-ten-by-ten { @@ -94,7 +94,7 @@ class SpritesTest < Test::Unit::TestCase assert_not_nil Dir.glob("#{@generated_images_tmp_path}/squares-s*.png").first assert_correct <<-CSS, css .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/images/generated/squares-s161c60ad78.png') no-repeat; + background: url('/images/generated/squares-sbbc18e2129.png') no-repeat; } .squares-ten-by-ten { @@ -115,7 +115,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-s161c60ad78.png') no-repeat; + background: url('/squares-sbbc18e2129.png') no-repeat; } .squares-ten-by-ten { @@ -147,7 +147,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .cubicle, .large-cube { - background: url('/squares-s161c60ad78.png') no-repeat; + background: url('/squares-sbbc18e2129.png') no-repeat; } .cubicle { @@ -172,7 +172,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .circles { - background: url('/squares-s161c60ad78.png') no-repeat; + background: url('/squares-sbbc18e2129.png') no-repeat; } CSS assert_equal image_size('squares-s*.png'), [20, 30] @@ -186,7 +186,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-s89450808af.png') no-repeat; + background: url('/squares-s563a5e0855.png') no-repeat; } .squares-ten-by-ten { @@ -208,7 +208,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-s673837183a.png') no-repeat; + background: url('/squares-s4ea353fa6d.png') no-repeat; } .squares-ten-by-ten { @@ -231,7 +231,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-s1cd84c9068.png') no-repeat; + background: url('/squares-sf4771cb124.png') no-repeat; } .squares-ten-by-ten { @@ -254,7 +254,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-sf25b7090ca.png') no-repeat; + background: url('/squares-sc82d6f3cf4.png') no-repeat; } .squares-ten-by-ten { @@ -276,7 +276,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-sd66bf24bab.png') no-repeat; + background: url('/squares-s2f4aa65dcf.png') no-repeat; } .squares-ten-by-ten { @@ -311,7 +311,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite { - background: url('/squares-s8e490168dd.png') no-repeat; + background: url('/squares-sce5dc30797.png') no-repeat; } .adjusted-percentage { @@ -349,7 +349,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .adjusted-percentage, .adjusted-px-1, .adjusted-px-2 { - background: url('/squares-s8e490168dd.png') no-repeat; + background: url('/squares-sce5dc30797.png') no-repeat; } .adjusted-percentage { @@ -376,7 +376,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-sa5550fd132.png') no-repeat; + background: url('/squares-sbab486c25a.png') no-repeat; } .squares-ten-by-ten { @@ -400,7 +400,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares-sprite, .squares-ten-by-ten, .squares-twenty-by-twenty { - background: url('/squares-s89a274044e.png') no-repeat; + background: url('/squares-sb9d9a8ca6a.png') no-repeat; } .squares-ten-by-ten { @@ -449,7 +449,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .squares { - background: url('/squares-s145869726f.png') 0 -10px no-repeat; + background: url('/squares-sd817b59156.png') 0 -10px no-repeat; } CSS end @@ -468,7 +468,7 @@ class SpritesTest < Test::Unit::TestCase assert_equal image_size('squares-s*.png'), [20, 40] assert_correct css, <<-CSS .squares-sprite { - background: url('/squares-se3c68372d9.png') no-repeat; + background: url('/squares-s555875d730.png') no-repeat; } .foo { @@ -488,7 +488,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .selectors-sprite, .selectors-ten-by-ten { - background: url('/selectors-sedfef809e2.png') no-repeat; + background: url('/selectors-s7e84acb3d2.png') no-repeat; } .selectors-ten-by-ten { @@ -513,7 +513,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .selectors-sprite, .selectors-ten-by-ten { - background: url('/selectors-sedfef809e2.png') no-repeat; + background: url('/selectors-s7e84acb3d2.png') no-repeat; } .selectors-ten-by-ten { @@ -540,7 +540,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .selectors-sprite, a { - background: url('/selectors-sedfef809e2.png') no-repeat; + background: url('/selectors-s7e84acb3d2.png') no-repeat; } a { @@ -569,7 +569,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .selectors-sprite, a { - background: url('/selectors-sedfef809e2.png') no-repeat; + background: url('/selectors-s7e84acb3d2.png') no-repeat; } a { @@ -587,7 +587,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .selectors-sprite, a { - background: url('/selectors-sedfef809e2.png') no-repeat; + background: url('/selectors-s7e84acb3d2.png') no-repeat; } a { @@ -624,7 +624,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .ko-sprite, .ko-default_background, .ko-starbg26x27 { - background: url('/ko-scc3f80660d.png') no-repeat; + background: url('/ko-sd6b4d44430.png') no-repeat; } .ko-default_background { @@ -681,7 +681,7 @@ class SpritesTest < Test::Unit::TestCase SCSS assert_correct css, <<-CSS .nested-sprite, .nested-ten-by-ten { - background: url('/nested-s55a8935544.png') no-repeat; + background: url('/nested-s7b93e0b6bf.png') no-repeat; } .nested-ten-by-ten { @@ -704,7 +704,7 @@ class SpritesTest < Test::Unit::TestCase assert_equal [30, 20], image_size('squares-s*.png') other_css = <<-CSS .squares-sprite { - background: url('/squares-s161c60ad78.png') no-repeat; + background: url('/squares-s4bd95c5c56.png') no-repeat; } .foo { diff --git a/test/test_helper.rb b/test/test_helper.rb index de3fa125..ccae6160 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -49,7 +49,9 @@ module SpriteHelper path, name = Compass::SpriteImporter.path_and_name(uri) sprite_names = Compass::SpriteImporter.sprite_names(uri) sass_engine = Compass::SpriteImporter.sass_engine(uri, name, importer, options) - Compass::SassExtensions::Sprites::SpriteMap.new(sprite_names.map{|n| "selectors/#{n}.png"}, path, name, sass_engine, options) + map = Compass::SassExtensions::Sprites::SpriteMap.new(sprite_names.map{|n| "selectors/#{n}.png"}, path, name, sass_engine, options) + map.options = {:compass => {:logger => Compass::NullLogger.new}} + map end def create_sprite_temp diff --git a/test/units/sprites/sprite_map_test.rb b/test/units/sprites/sprite_map_test.rb index ff72467b..5f1e8025 100644 --- a/test/units/sprites/sprite_map_test.rb +++ b/test/units/sprites/sprite_map_test.rb @@ -35,7 +35,7 @@ class SpriteMapTest < Test::Unit::TestCase end test 'uniqueness_hash' do - assert_equal 'ef52c5c63a', @base.uniqueness_hash + assert_equal '4c703bbc05', @base.uniqueness_hash end it 'should be outdated' do @@ -103,7 +103,9 @@ class SpriteMapTest < Test::Unit::TestCase path, name = Compass::SpriteImporter.path_and_name(uri) sprite_names = Compass::SpriteImporter.sprite_names(uri) sass_engine = Compass::SpriteImporter.sass_engine(uri, name, importer, options) - Compass::SassExtensions::Sprites::SpriteMap.new(sprite_names.map {|n| "image_row/#{n}.png"}, path, name, sass_engine, options) + map = Compass::SassExtensions::Sprites::SpriteMap.new(sprite_names.map {|n| "image_row/#{n}.png"}, path, name, sass_engine, options) + map.options = {:compass => {:logger => Compass::NullLogger.new}} + map end it "should have a smart layout" do