mojo_magick 0.5.7 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +0,0 @@
1
- class Hash
2
- def symbolize_keys!
3
- keys.each do |key|
4
- self[begin
5
- key.to_sym
6
- rescue StandardError
7
- key
8
- end || key] = delete(key)
9
- end
10
- self
11
- end
12
- end
data/test/fonts_test.rb DELETED
@@ -1,11 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
2
-
3
- class FontsTest < MiniTest::Test
4
- def test_get_fonts
5
- fonts = MojoMagick.get_fonts
6
- assert fonts.is_a? Array
7
- assert fonts.length > 1
8
- assert fonts.first.name
9
- assert(fonts.first.name.is_a?(String))
10
- end
11
- end
@@ -1,49 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'test_helper')
2
-
3
- class ResourceLimitsTest < MiniTest::Test
4
- def setup
5
- @orig_limits = MojoMagick.get_default_limits
6
- end
7
-
8
- def test_set_limits
9
- # set area to 32mb limit
10
- MojoMagick.set_limits(area: '32mb')
11
- new_limits = MojoMagick.get_current_limits
12
- assert_equal '32mb', new_limits[:area].downcase
13
- end
14
-
15
- def test_get_limits
16
- assert(@orig_limits.size >= 7)
17
- end
18
-
19
- def test_resource_limits
20
- orig_limits_test = @orig_limits.dup
21
- orig_limits_test.delete_if do |resource, _value|
22
- assert %i[throttle area map disk memory file thread time].include?(resource), "Found unexpected resource #{resource}"
23
- true
24
- end
25
- assert_equal 0, orig_limits_test.size
26
- end
27
-
28
- def test_get_current_limits
29
- # remove limits on area
30
- MojoMagick.remove_limits(:area)
31
- new_limits = MojoMagick.get_current_limits
32
- assert_equal @orig_limits[:area], new_limits[:area]
33
- end
34
-
35
- def test_set_limits_again
36
- # set memory to 64 mb, disk to 0 and
37
- MojoMagick.set_limits(memory: '64mb', disk: '0b')
38
- new_limits = MojoMagick.get_current_limits(show_actual_values: true)
39
- assert_equal 61, new_limits[:memory]
40
- assert_equal 0, new_limits[:disk]
41
- end
42
-
43
- def test_unset_limits
44
- # return to original/default limit values
45
- MojoMagick.unset_limits
46
- new_limits = MojoMagick.get_current_limits
47
- assert_equal @orig_limits, new_limits
48
- end
49
- end