mojo_magick 0.5.6 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +0,0 @@
1
- class Hash
2
- def symbolize_keys!
3
- keys.each do |key|
4
- self[(key.to_sym rescue key) || key] = delete(key)
5
- end
6
- self
7
- end
8
- end
@@ -1,12 +0,0 @@
1
- require File::join(File::dirname(__FILE__), 'test_helper')
2
-
3
- class FontsTest < MiniTest::Unit::TestCase
4
-
5
- def test_get_fonts
6
- fonts = MojoMagick::get_fonts
7
- assert fonts.is_a? Array
8
- assert fonts.length > 1
9
- assert fonts.first.name
10
- assert (fonts.first.name.is_a? String)
11
- end
12
- end
@@ -1,30 +0,0 @@
1
- require File::join(File::dirname(__FILE__), 'test_helper')
2
-
3
- IDENTIFY_FONT_RESPONSE =<<EOF
4
-
5
- Font: Zapf-Dingbats
6
- family: Zapf Dingbats
7
- style: Normal
8
- stretch: Normal
9
- weight: 400
10
- glyphs: /System/Library/Fonts/ZapfDingbats.ttf
11
-
12
- Font: Zapfino
13
- family: Zapfino
14
- style: Italic
15
- stretch: Normal
16
- weight: 400
17
- glyphs: /Library/Fonts/Zapfino.ttf
18
-
19
-
20
- EOF
21
-
22
- class ParserTest < MiniTest::Unit::TestCase
23
-
24
- def test_parse_fonts
25
- parser = MojoMagick::Util::Parser.new
26
- parsed_fonts = parser.parse_fonts(IDENTIFY_FONT_RESPONSE)
27
- assert_equal parsed_fonts.length, 2
28
- assert_equal parsed_fonts[1].style, 'Italic'
29
- end
30
- end
@@ -1,51 +0,0 @@
1
- require File::join(File::dirname(__FILE__), 'test_helper')
2
-
3
- class ResourceLimitsTest < MiniTest::Unit::TestCase
4
-
5
- def setup
6
- @orig_limits = MojoMagick::get_default_limits
7
- end
8
-
9
- def test_set_limits
10
- # set area to 32mb limit
11
- MojoMagick::set_limits(:area => '32mb')
12
- new_limits = MojoMagick::get_current_limits
13
- assert_equal '32mb', new_limits[:area].downcase
14
- end
15
-
16
- def test_get_limits
17
- assert(@orig_limits.size >= 7)
18
- end
19
-
20
- def test_resource_limits
21
- orig_limits_test = @orig_limits.dup
22
- orig_limits_test.delete_if do |resource, value|
23
- assert [:throttle, :area, :map, :disk, :memory, :file, :thread, :time].include?(resource), "Found unexpected resource #{resource}"
24
- true
25
- end
26
- assert_equal 0, orig_limits_test.size
27
- end
28
-
29
- def test_get_current_limits
30
- # remove limits on area
31
- MojoMagick::remove_limits(:area)
32
- new_limits = MojoMagick::get_current_limits
33
- assert_equal @orig_limits[:area], new_limits[:area]
34
- end
35
-
36
- def test_set_limits
37
- # set memory to 64 mb, disk to 0 and
38
- MojoMagick::set_limits(:memory => '64mb', :disk => '0b')
39
- new_limits = MojoMagick::get_current_limits(:show_actual_values => true)
40
- assert_equal 61, new_limits[:memory]
41
- assert_equal 0, new_limits[:disk]
42
- end
43
-
44
- def test_unset_limits
45
- # return to original/default limit values
46
- MojoMagick::unset_limits
47
- new_limits = MojoMagick::get_current_limits
48
- assert_equal @orig_limits, new_limits
49
- end
50
-
51
- end