mojo_magick 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -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