passing tests for new vertical layout based on file size
This commit is contained in:
parent
7a183754b7
commit
b581d2e1a7
@ -7,7 +7,7 @@ GIT
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
compass (0.12.0.alpha.0.38cf0e5)
|
compass (0.12.0.alpha.0.7a18375)
|
||||||
chunky_png (~> 1.2)
|
chunky_png (~> 1.2)
|
||||||
fssm (>= 0.2.7)
|
fssm (>= 0.2.7)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
|
@ -16,6 +16,7 @@ module Compass
|
|||||||
calculate_horizontal_positions
|
calculate_horizontal_positions
|
||||||
calculate_width
|
calculate_width
|
||||||
else
|
else
|
||||||
|
@images.sort! {|a,b| File.size(b.file) <=> File.size(a.file)} #put small images first
|
||||||
calculate_width
|
calculate_width
|
||||||
calulate_vertical_postions
|
calulate_vertical_postions
|
||||||
calculate_height
|
calculate_height
|
||||||
|
1416
test/fixtures/stylesheets/compass/css/sprites.css
vendored
1416
test/fixtures/stylesheets/compass/css/sprites.css
vendored
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 103 KiB |
@ -115,5 +115,11 @@ class SpriteMapTest < Test::Unit::TestCase
|
|||||||
FileUtils.rm base.filename
|
FileUtils.rm base.filename
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should generate vertical sprites in decending order" do
|
||||||
|
sizes = @base.images.map{|image| File.size(image.file) }
|
||||||
|
assert_equal sizes.min, File.size(@base.images.first.file)
|
||||||
|
assert_equal sizes.max, File.size(@base.images.last.file)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user