Created
January 9, 2012 17:48
-
-
Save jimryan/1584089 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
should "save the files as the right formats and sizes" do | |
[[:large, 400, 61, "PNG"], | |
[:medium, 100, 15, "GIF"], | |
[:small, 32, 32, "JPEG"]].each do |style| | |
cmd = %Q[identify -format "%w %h %b %m" "#{@attachment.path(style.first)}"] | |
out = `#{cmd}` | |
width, height, size, format = out.split(" ") | |
assert_equal style[1].to_s, width.to_s | |
assert_equal style[2].to_s, height.to_s | |
assert_equal style[3].to_s, format.to_s | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment