Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
6721b469
Commit
6721b469
authored
Mar 08, 2013
by
Tieg Zaharia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests from animated gif layers optimize change
parent
4a625e00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
test/helper.rb
+9
-0
test/thumbnail_test.rb
+16
-9
No files found.
test/helper.rb
View file @
6721b469
...
...
@@ -197,3 +197,11 @@ end
def
assert_file_not_exists
(
path
)
assert
!
File
.
exists?
(
path
),
%(Expect "#{path}" to not exists.)
end
def
assert_frame_dimensions
(
range
,
frames
)
frames
.
each_with_index
do
|
frame
,
idx
|
frame
.
split
(
'x'
).
each_with_index
do
|
dim
,
idx
|
assert
range
.
include?
(
dim
.
to_i
),
"Frame
#{
idx
}
[
#{
idx
}
] should have been within
#{
range
.
inspect
}
, but was
#{
dim
}
"
end
end
end
\ No newline at end of file
test/thumbnail_test.rb
View file @
6721b469
...
...
@@ -380,8 +380,10 @@ class ThumbnailTest < Test::Unit::TestCase
should
"create the 12 frames thumbnail when sent #make"
do
dst
=
@thumb
.
make
cmd
=
%Q[identify -format "%wx%h" "
#{
dst
.
path
}
"]
assert_equal
(
"50x5050x5050x5050x5050x5050x49"
)
*
2
,
`
#{
cmd
}
`
.
chomp
cmd
=
%Q[identify -format "%wx%h," "
#{
dst
.
path
}
"]
frames
=
`
#{
cmd
}
`
.
chomp
.
split
(
','
)
assert_equal
12
,
frames
.
size
assert_frame_dimensions
(
45
..
50
),
frames
end
should
"use the -coalesce option"
do
...
...
@@ -400,8 +402,10 @@ class ThumbnailTest < Test::Unit::TestCase
should
"create the 12 frames thumbnail when sent #make"
do
dst
=
@thumb
.
make
cmd
=
%Q[identify -format "%wx%h" "
#{
dst
.
path
}
"]
assert_equal
(
"50x5050x5050x5050x5050x5050x49"
)
*
2
,
`
#{
cmd
}
`
.
chomp
cmd
=
%Q[identify -format "%wx%h," "
#{
dst
.
path
}
"]
frames
=
`
#{
cmd
}
`
.
chomp
.
split
(
','
)
assert_equal
12
,
frames
.
size
assert_frame_dimensions
(
45
..
50
),
frames
end
should
"use the -coalesce option"
do
...
...
@@ -421,9 +425,10 @@ class ThumbnailTest < Test::Unit::TestCase
should
"create the 12 frames thumbnail when sent #make"
do
dst
=
@thumb
.
make
cmd
=
%Q[identify -format "%wx%h" "
#{
dst
.
path
}
"]
assert_equal
"60x6059x5959x5959x5960x5959x5859x6059x5959x5959x5960x5959x58"
,
`
#{
cmd
}
`
.
chomp
cmd
=
%Q[identify -format "%wx%h," "
#{
dst
.
path
}
"]
frames
=
`
#{
cmd
}
`
.
chomp
.
split
(
','
)
assert_equal
12
,
frames
.
size
assert_frame_dimensions
(
55
..
60
),
frames
end
should
"use the -coalesce option"
do
...
...
@@ -443,8 +448,10 @@ class ThumbnailTest < Test::Unit::TestCase
should
"create the 12 frames thumbnail when sent #make"
do
dst
=
@thumb
.
make
cmd
=
%Q[identify -format "%wx%h" "
#{
dst
.
path
}
"]
assert_equal
"70x7067x6867x6868x6769x6767x6768x6967x6867x6868x6769x6767x67"
,
`
#{
cmd
}
`
.
chomp
cmd
=
%Q[identify -format "%wx%h," "
#{
dst
.
path
}
"]
frames
=
`
#{
cmd
}
`
.
chomp
.
split
(
','
)
assert_equal
12
,
frames
.
size
assert_frame_dimensions
(
60
..
70
),
frames
end
should
"use the -coalesce option"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment