rmagick 2.15.3 → 2.15.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rmagick might be problematic. Click here for more details.

Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +14 -0
  3. data/.rubocop.yml +27 -3
  4. data/.travis.yml +9 -6
  5. data/CHANGELOG.md +4 -0
  6. data/CONTRIBUTING.md +10 -0
  7. data/README.textile +4 -0
  8. data/before_install_linux.sh +4 -4
  9. data/doc/ex/gravity.rb +2 -1
  10. data/ext/RMagick/extconf.rb +60 -17
  11. data/lib/rmagick/version.rb +1 -1
  12. data/lib/rvg/clippath.rb +37 -36
  13. data/lib/rvg/container.rb +106 -107
  14. data/lib/rvg/deep_equal.rb +46 -48
  15. data/lib/rvg/describable.rb +35 -36
  16. data/lib/rvg/embellishable.rb +384 -380
  17. data/lib/rvg/misc.rb +705 -690
  18. data/lib/rvg/paint.rb +39 -40
  19. data/lib/rvg/pathdata.rb +120 -121
  20. data/lib/rvg/rvg.rb +212 -209
  21. data/lib/rvg/stretchable.rb +159 -158
  22. data/lib/rvg/stylable.rb +99 -100
  23. data/lib/rvg/text.rb +0 -1
  24. data/lib/rvg/transformable.rb +110 -110
  25. data/lib/rvg/units.rb +58 -58
  26. data/rmagick.gemspec +1 -1
  27. data/spec/rmagick/image/blue_shift_spec.rb +16 -0
  28. data/spec/rmagick/image/composite_spec.rb +140 -0
  29. data/spec/rmagick/image/constitute_spec.rb +15 -0
  30. data/spec/rmagick/image/dispatch_spec.rb +18 -0
  31. data/spec/rmagick/image/from_blob_spec.rb +14 -0
  32. data/spec/rmagick/image/ping_spec.rb +14 -0
  33. data/spec/rmagick/image/properties_spec.rb +29 -0
  34. data/spec/spec_helper.rb +3 -0
  35. data/test/Image1.rb +524 -718
  36. data/test/Image2.rb +1262 -1262
  37. data/test/Image3.rb +973 -973
  38. data/test/ImageList2.rb +341 -341
  39. data/test/Image_attributes.rb +678 -678
  40. data/test/Info.rb +336 -336
  41. data/test/Magick.rb +245 -242
  42. data/test/Pixel.rb +105 -105
  43. data/test/Preview.rb +42 -42
  44. metadata +21 -6
@@ -6,340 +6,340 @@ require 'test/unit'
6
6
  require 'test/unit/ui/console/testrunner' unless RUBY_VERSION[/^1\.9|^2/]
7
7
 
8
8
  class Info_UT < Test::Unit::TestCase
9
- def setup
10
- @info = Magick::Image::Info.new
11
- end
12
-
13
- def test_options
14
- # 1-argument form
15
- assert_nothing_raised { @info['fill'] }
16
- assert_nil(@info['fill'])
17
-
18
- assert_nothing_raised { @info['fill'] = 'red' }
19
- assert_equal('red', @info['fill'])
20
-
21
- assert_nothing_raised { @info['fill'] = nil }
22
- assert_nil(@info['fill'])
23
-
24
- # 2-argument form
25
- assert_nothing_raised { @info['tiff', 'bits-per-sample'] = 2 }
26
- assert_equal('2', @info['tiff', 'bits-per-sample'])
27
-
28
- # define and undefine
29
- assert_nothing_raised { @info.define('tiff', 'bits-per-sample', 4) }
30
- assert_equal('4', @info['tiff', 'bits-per-sample'])
31
-
32
- assert_nothing_raised { @info.undefine('tiff', 'bits-per-sample') }
33
- assert_nil(@info['tiff', 'bits-per-sample'])
34
- end
35
-
36
- def test_antialias
37
- assert @info.antialias
38
- assert_nothing_raised { @info.antialias = false }
39
- assert !@info.antialias
40
- end
41
-
42
- def test_attenuate
43
- assert_nothing_raised { @info.attenuate = 10 }
44
- assert_equal(10, @info.attenuate)
45
- assert_nothing_raised { @info.attenuate = 5.25 }
46
- assert_equal(5.25, @info.attenuate)
47
- assert_nothing_raised { @info.attenuate = nil }
48
- assert_equal(nil, @info.attenuate)
49
- end
50
-
51
- def test_authenticate
52
- assert_nothing_raised { @info.authenticate = 'string' }
53
- assert_equal('string', @info.authenticate)
54
- end
55
-
56
- def test_background_color
57
- assert_nothing_raised { @info.background_color = 'red' }
58
- red = Magick::Pixel.new(Magick::QuantumRange)
59
- assert_nothing_raised { @info.background_color = red }
60
- assert_equal('red', @info.background_color)
61
- img = Magick::Image.new(20,20) { self.background_color = 'red' }
62
- assert_equal('red', img.background_color)
63
- end
64
-
65
- def test_border_color
66
- assert_nothing_raised { @info.border_color = 'red' }
67
- red = Magick::Pixel.new(Magick::QuantumRange)
68
- assert_nothing_raised { @info.border_color = red }
69
- assert_equal('red', @info.border_color)
70
- img = Magick::Image.new(20,20) { self.border_color = 'red' }
71
- assert_equal('red', img.border_color)
72
- end
73
-
74
- def caption
75
- assert_nothing_raised { @info.caption = 'string' }
76
- assert_equal('string', @info.caption)
77
- img = Magick::Image.new(20,20) { self.caption = 'string' }
78
- assert_equal('string', img.caption)
79
- end
80
-
81
- def test_channel
82
- assert_nothing_raised { @info.channel(Magick::RedChannel) }
83
- assert_nothing_raised { @info.channel(Magick::RedChannel, Magick::BlueChannel) }
84
- assert_raise(TypeError) { @info.channel(1) }
85
- assert_raise(TypeError) { @info.channel(Magick::RedChannel, 1) }
86
- end
87
-
88
- def test_colorspace
89
- Magick::ColorspaceType.values.each do |cs|
90
- assert_nothing_raised {@info.colorspace = cs}
91
- assert_equal(cs, @info.colorspace)
92
- end
93
- end
94
-
95
- def test_comment
96
- assert_nothing_raised { @info.comment = 'comment' }
97
- assert_equal('comment', @info.comment)
98
- end
99
-
100
- def test_compression
101
- Magick::CompressionType.values.each do |v|
102
- assert_nothing_raised { @info.compression = v }
103
- assert_equal(v, @info.compression)
104
- end
105
- end
106
-
107
- def test_define
108
- assert_nothing_raised { @info.define('tiff', 'bits-per-sample', 2) }
109
- assert_nothing_raised { @info.undefine('tiff', 'bits-per-sample') }
110
- end
111
-
112
- def test_density
113
- assert_nothing_raised { @info.density = '72x72' }
114
- assert_equal('72x72', @info.density)
115
- assert_nothing_raised { @info.density = Magick::Geometry.new(72, 72) }
116
- assert_equal('72x72', @info.density)
117
- end
118
-
119
- def test_delay
120
- assert_nothing_raised { @info.delay = 60 }
121
- assert_equal(60, @info.delay)
122
- end
123
-
124
- def test_depth
125
- assert_nothing_raised { @info.depth = 8 }
126
- assert_equal(8, @info.depth)
127
- assert_nothing_raised { @info.depth = 16 }
128
- assert_equal(16, @info.depth)
129
- assert_raise(ArgumentError) { @info.depth = 32 }
130
- end
131
-
132
- def test_dispose
133
- Magick::DisposeType.values.each do |v|
134
- assert_nothing_raised { @info.dispose = v }
135
- assert_equal(v, @info.dispose)
136
- end
137
- end
138
-
139
- def test_dither
140
- assert_nothing_raised { @info.dither = true }
141
- assert_equal(true, @info.dither)
142
- assert_nothing_raised { @info.dither = false }
143
- assert_equal(false, @info.dither)
144
- end
145
-
146
- def test_extract
147
- assert_nothing_raised { @info.extract = '100x100' }
148
- assert_equal('100x100', @info.extract)
149
- assert_nothing_raised { @info.extract = Magick::Geometry.new(100, 100) }
150
- assert_equal('100x100', @info.extract)
151
- end
152
-
153
- def test_filename
154
- assert_nothing_raised { @info.filename = 'string' }
155
- assert_equal('string', @info.filename)
156
- end
157
-
158
- def test_fill
159
- assert_nothing_raised { @info.fill }
160
- assert_nil(@info.fill)
161
-
162
- assert_nothing_raised { @info.fill = 'white' }
163
- assert_equal('white', @info.fill)
164
-
165
- assert_nothing_raised { @info.fill = nil }
166
- assert_nil(@info.fill)
167
-
168
- assert_raise(ArgumentError) { @info.fill = 'xxx' }
169
- end
170
-
171
- def test_font
172
- assert_nothing_raised { @info.font = 'Arial' }
173
- assert_equal('Arial', @info.font)
174
- end
175
-
176
- def test_format
177
- assert_nothing_raised { @info.format = 'GIF' }
178
- assert_equal('GIF', @info.format)
179
- end
180
-
181
- def test_fuzz
182
- assert_nothing_raised { @info.fuzz = 50 }
183
- assert_equal(50, @info.fuzz)
184
- assert_nothing_raised { @info.fuzz = '50%' }
185
- assert_equal(Magick::QuantumRange * 0.5, @info.fuzz)
186
- end
187
-
188
- def test_gravity
189
- Magick::GravityType.values.each do |v|
190
- assert_nothing_raised { @info.gravity = v }
191
- assert_equal(v, @info.gravity)
192
- end
193
- end
194
-
195
- def test_image_type
196
- Magick::ImageType.values.each do |v|
197
- assert_nothing_raised { @info.image_type = v }
198
- assert_equal(v, @info.image_type)
199
- end
200
- end
201
-
202
- def test_interlace
203
- Magick::InterlaceType.values.each do |v|
204
- assert_nothing_raised { @info.interlace = v }
205
- assert_equal(v, @info.interlace)
206
- end
207
- end
208
-
209
- def test_label
210
- assert_nothing_raised { @info.label = 'string' }
211
- assert_equal('string', @info.label)
212
- end
213
-
214
- def test_matte_color
215
- assert_nothing_raised { @info.matte_color = 'red' }
216
- red = Magick::Pixel.new(Magick::QuantumRange)
217
- assert_nothing_raised { @info.matte_color = red }
218
- assert_equal('red', @info.matte_color)
219
- img = Magick::Image.new(20,20) { self.matte_color = 'red' }
220
- assert_equal('red', img.matte_color)
221
- end
222
-
223
- def test_monitor
224
- assert_nothing_raised { @info.monitor = lambda {} }
225
- monitor = proc do |mth, q, s|
226
- assert_equal('resize!', mth)
227
- assert_instance_of(Fixnum, q)
228
- assert_instance_of(Fixnum, s)
229
- true
230
- end
231
- img = Magick::Image.new(2000, 2000) { self.monitor = monitor }
232
- img.resize!(20, 20)
233
- img.monitor = nil
234
- end
235
-
236
- def test_monochrome
237
- assert_nothing_raised { @info.monochrome = true }
238
- assert @info.monochrome
239
- end
240
-
241
- def test_orientation
242
- Magick::OrientationType.values.each do |v|
243
- assert_nothing_raised { @info.orientation = v }
244
- assert_equal(v, @info.orientation)
245
- end
246
- end
247
-
248
- def test_origin
249
- assert_nothing_raised { @info.origin = '+10+10' }
250
- assert_equal('+10+10', @info.origin)
251
- assert_nothing_raised { @info.origin = Magick::Geometry.new(nil, nil, 10, 10) }
252
- assert_equal('+10+10', @info.origin)
253
- end
254
-
255
- def test_page
256
- assert_nothing_raised { @info.page = '612x792>' }
257
- assert_equal('612x792>', @info.page)
258
- end
259
-
260
- def test_pointsize
261
- assert_nothing_raised { @info.pointsize = 12 }
262
- assert_equal(12, @info.pointsize)
263
- end
264
-
265
- def test_quality
266
- assert_nothing_raised { @info.quality = 75 }
267
- assert_equal(75, @info.quality)
268
- end
269
-
270
- def test_sampling_factor
271
- assert_nothing_raised { @info.sampling_factor = '2x1' }
272
- assert_equal('2x1', @info.sampling_factor)
273
- end
274
-
275
- def test_server_name
276
- assert_nothing_raised { @info.server_name = 'foo' }
277
- assert_equal('foo', @info.server_name)
278
- end
279
-
280
- def test_size
281
- assert_nothing_raised { @info.size = '200x100' }
282
- assert_equal('200x100', @info.size)
283
- assert_nothing_raised { @info.size = Magick::Geometry.new(100,200) }
284
- assert_equal('100x200', @info.size)
285
- end
286
-
287
- def test_stroke
288
- assert_nothing_raised { @info.stroke }
289
- assert_nil(@info.stroke)
290
-
291
- assert_nothing_raised { @info.stroke = 'white' }
292
- assert_equal('white', @info.stroke)
293
-
294
- assert_nothing_raised { @info.stroke = nil }
295
- assert_nil(@info.stroke)
296
-
297
- assert_raise(ArgumentError) { @info.stroke = 'xxx' }
298
- end
299
-
300
- def test_stroke_width
301
- assert_nothing_raised { @info.stroke_width = 10 }
302
- assert_equal(10, @info.stroke_width)
303
- assert_nothing_raised { @info.stroke_width = 5.25 }
304
- assert_equal(5.25, @info.stroke_width)
305
- assert_nothing_raised { @info.stroke_width = nil }
306
- assert_equal(nil, @info.stroke_width)
307
- end
308
-
309
- def test_texture
310
- img = Magick::Image.read('granite:') {self.size = '20x20' }
311
- assert_nothing_raised { @info.texture = img.first }
312
- end
313
-
314
- def test_tile_offset
315
- assert_nothing_raised { @info.tile_offset = '200x100' }
316
- assert_equal('200x100', @info.tile_offset)
317
- assert_nothing_raised { @info.tile_offset = Magick::Geometry.new(100,200) }
318
- assert_equal('100x200', @info.tile_offset)
319
- end
320
-
321
- def test_undercolor
322
- assert_nothing_raised { @info.undercolor }
323
- assert_nil(@info.undercolor)
324
-
325
- assert_nothing_raised { @info.undercolor = 'white' }
326
- assert_equal('white', @info.undercolor)
327
-
328
- assert_nothing_raised { @info.undercolor = nil }
329
- assert_nil(@info.undercolor)
330
-
331
- assert_raise(ArgumentError) { @info.undercolor = 'xxx' }
332
- end
333
-
334
- def test_units
335
- Magick::ResolutionType.values.each do |v|
336
- assert_nothing_raised { @info.units = v }
337
- assert_equal(v, @info.units)
338
- end
339
- end
340
-
341
- def test_view
342
- assert_nothing_raised { @info.view = 'string' }
343
- assert_equal('string', @info.view)
344
- end
9
+ def setup
10
+ @info = Magick::Image::Info.new
11
+ end
12
+
13
+ def test_options
14
+ # 1-argument form
15
+ assert_nothing_raised { @info['fill'] }
16
+ assert_nil(@info['fill'])
17
+
18
+ assert_nothing_raised { @info['fill'] = 'red' }
19
+ assert_equal('red', @info['fill'])
20
+
21
+ assert_nothing_raised { @info['fill'] = nil }
22
+ assert_nil(@info['fill'])
23
+
24
+ # 2-argument form
25
+ assert_nothing_raised { @info['tiff', 'bits-per-sample'] = 2 }
26
+ assert_equal('2', @info['tiff', 'bits-per-sample'])
27
+
28
+ # define and undefine
29
+ assert_nothing_raised { @info.define('tiff', 'bits-per-sample', 4) }
30
+ assert_equal('4', @info['tiff', 'bits-per-sample'])
31
+
32
+ assert_nothing_raised { @info.undefine('tiff', 'bits-per-sample') }
33
+ assert_nil(@info['tiff', 'bits-per-sample'])
34
+ end
35
+
36
+ def test_antialias
37
+ assert @info.antialias
38
+ assert_nothing_raised { @info.antialias = false }
39
+ assert !@info.antialias
40
+ end
41
+
42
+ def test_attenuate
43
+ assert_nothing_raised { @info.attenuate = 10 }
44
+ assert_equal(10, @info.attenuate)
45
+ assert_nothing_raised { @info.attenuate = 5.25 }
46
+ assert_equal(5.25, @info.attenuate)
47
+ assert_nothing_raised { @info.attenuate = nil }
48
+ assert_equal(nil, @info.attenuate)
49
+ end
50
+
51
+ def test_authenticate
52
+ assert_nothing_raised { @info.authenticate = 'string' }
53
+ assert_equal('string', @info.authenticate)
54
+ end
55
+
56
+ def test_background_color
57
+ assert_nothing_raised { @info.background_color = 'red' }
58
+ red = Magick::Pixel.new(Magick::QuantumRange)
59
+ assert_nothing_raised { @info.background_color = red }
60
+ assert_equal('red', @info.background_color)
61
+ img = Magick::Image.new(20,20) { self.background_color = 'red' }
62
+ assert_equal('red', img.background_color)
63
+ end
64
+
65
+ def test_border_color
66
+ assert_nothing_raised { @info.border_color = 'red' }
67
+ red = Magick::Pixel.new(Magick::QuantumRange)
68
+ assert_nothing_raised { @info.border_color = red }
69
+ assert_equal('red', @info.border_color)
70
+ img = Magick::Image.new(20,20) { self.border_color = 'red' }
71
+ assert_equal('red', img.border_color)
72
+ end
73
+
74
+ def caption
75
+ assert_nothing_raised { @info.caption = 'string' }
76
+ assert_equal('string', @info.caption)
77
+ img = Magick::Image.new(20,20) { self.caption = 'string' }
78
+ assert_equal('string', img.caption)
79
+ end
80
+
81
+ def test_channel
82
+ assert_nothing_raised { @info.channel(Magick::RedChannel) }
83
+ assert_nothing_raised { @info.channel(Magick::RedChannel, Magick::BlueChannel) }
84
+ assert_raise(TypeError) { @info.channel(1) }
85
+ assert_raise(TypeError) { @info.channel(Magick::RedChannel, 1) }
86
+ end
87
+
88
+ def test_colorspace
89
+ Magick::ColorspaceType.values.each do |cs|
90
+ assert_nothing_raised {@info.colorspace = cs}
91
+ assert_equal(cs, @info.colorspace)
92
+ end
93
+ end
94
+
95
+ def test_comment
96
+ assert_nothing_raised { @info.comment = 'comment' }
97
+ assert_equal('comment', @info.comment)
98
+ end
99
+
100
+ def test_compression
101
+ Magick::CompressionType.values.each do |v|
102
+ assert_nothing_raised { @info.compression = v }
103
+ assert_equal(v, @info.compression)
104
+ end
105
+ end
106
+
107
+ def test_define
108
+ assert_nothing_raised { @info.define('tiff', 'bits-per-sample', 2) }
109
+ assert_nothing_raised { @info.undefine('tiff', 'bits-per-sample') }
110
+ end
111
+
112
+ def test_density
113
+ assert_nothing_raised { @info.density = '72x72' }
114
+ assert_equal('72x72', @info.density)
115
+ assert_nothing_raised { @info.density = Magick::Geometry.new(72, 72) }
116
+ assert_equal('72x72', @info.density)
117
+ end
118
+
119
+ def test_delay
120
+ assert_nothing_raised { @info.delay = 60 }
121
+ assert_equal(60, @info.delay)
122
+ end
123
+
124
+ def test_depth
125
+ assert_nothing_raised { @info.depth = 8 }
126
+ assert_equal(8, @info.depth)
127
+ assert_nothing_raised { @info.depth = 16 }
128
+ assert_equal(16, @info.depth)
129
+ assert_raise(ArgumentError) { @info.depth = 32 }
130
+ end
131
+
132
+ def test_dispose
133
+ Magick::DisposeType.values.each do |v|
134
+ assert_nothing_raised { @info.dispose = v }
135
+ assert_equal(v, @info.dispose)
136
+ end
137
+ end
138
+
139
+ def test_dither
140
+ assert_nothing_raised { @info.dither = true }
141
+ assert_equal(true, @info.dither)
142
+ assert_nothing_raised { @info.dither = false }
143
+ assert_equal(false, @info.dither)
144
+ end
145
+
146
+ def test_extract
147
+ assert_nothing_raised { @info.extract = '100x100' }
148
+ assert_equal('100x100', @info.extract)
149
+ assert_nothing_raised { @info.extract = Magick::Geometry.new(100, 100) }
150
+ assert_equal('100x100', @info.extract)
151
+ end
152
+
153
+ def test_filename
154
+ assert_nothing_raised { @info.filename = 'string' }
155
+ assert_equal('string', @info.filename)
156
+ end
157
+
158
+ def test_fill
159
+ assert_nothing_raised { @info.fill }
160
+ assert_nil(@info.fill)
161
+
162
+ assert_nothing_raised { @info.fill = 'white' }
163
+ assert_equal('white', @info.fill)
164
+
165
+ assert_nothing_raised { @info.fill = nil }
166
+ assert_nil(@info.fill)
167
+
168
+ assert_raise(ArgumentError) { @info.fill = 'xxx' }
169
+ end
170
+
171
+ def test_font
172
+ assert_nothing_raised { @info.font = 'Arial' }
173
+ assert_equal('Arial', @info.font)
174
+ end
175
+
176
+ def test_format
177
+ assert_nothing_raised { @info.format = 'GIF' }
178
+ assert_equal('GIF', @info.format)
179
+ end
180
+
181
+ def test_fuzz
182
+ assert_nothing_raised { @info.fuzz = 50 }
183
+ assert_equal(50, @info.fuzz)
184
+ assert_nothing_raised { @info.fuzz = '50%' }
185
+ assert_equal(Magick::QuantumRange * 0.5, @info.fuzz)
186
+ end
187
+
188
+ def test_gravity
189
+ Magick::GravityType.values.each do |v|
190
+ assert_nothing_raised { @info.gravity = v }
191
+ assert_equal(v, @info.gravity)
192
+ end
193
+ end
194
+
195
+ def test_image_type
196
+ Magick::ImageType.values.each do |v|
197
+ assert_nothing_raised { @info.image_type = v }
198
+ assert_equal(v, @info.image_type)
199
+ end
200
+ end
201
+
202
+ def test_interlace
203
+ Magick::InterlaceType.values.each do |v|
204
+ assert_nothing_raised { @info.interlace = v }
205
+ assert_equal(v, @info.interlace)
206
+ end
207
+ end
208
+
209
+ def test_label
210
+ assert_nothing_raised { @info.label = 'string' }
211
+ assert_equal('string', @info.label)
212
+ end
213
+
214
+ def test_matte_color
215
+ assert_nothing_raised { @info.matte_color = 'red' }
216
+ red = Magick::Pixel.new(Magick::QuantumRange)
217
+ assert_nothing_raised { @info.matte_color = red }
218
+ assert_equal('red', @info.matte_color)
219
+ img = Magick::Image.new(20,20) { self.matte_color = 'red' }
220
+ assert_equal('red', img.matte_color)
221
+ end
222
+
223
+ def test_monitor
224
+ assert_nothing_raised { @info.monitor = lambda {} }
225
+ monitor = proc do |mth, q, s|
226
+ assert_equal('resize!', mth)
227
+ assert_instance_of(Fixnum, q)
228
+ assert_instance_of(Fixnum, s)
229
+ true
230
+ end
231
+ img = Magick::Image.new(2000, 2000) { self.monitor = monitor }
232
+ img.resize!(20, 20)
233
+ img.monitor = nil
234
+ end
235
+
236
+ def test_monochrome
237
+ assert_nothing_raised { @info.monochrome = true }
238
+ assert @info.monochrome
239
+ end
240
+
241
+ def test_orientation
242
+ Magick::OrientationType.values.each do |v|
243
+ assert_nothing_raised { @info.orientation = v }
244
+ assert_equal(v, @info.orientation)
245
+ end
246
+ end
247
+
248
+ def test_origin
249
+ assert_nothing_raised { @info.origin = '+10+10' }
250
+ assert_equal('+10+10', @info.origin)
251
+ assert_nothing_raised { @info.origin = Magick::Geometry.new(nil, nil, 10, 10) }
252
+ assert_equal('+10+10', @info.origin)
253
+ end
254
+
255
+ def test_page
256
+ assert_nothing_raised { @info.page = '612x792>' }
257
+ assert_equal('612x792>', @info.page)
258
+ end
259
+
260
+ def test_pointsize
261
+ assert_nothing_raised { @info.pointsize = 12 }
262
+ assert_equal(12, @info.pointsize)
263
+ end
264
+
265
+ def test_quality
266
+ assert_nothing_raised { @info.quality = 75 }
267
+ assert_equal(75, @info.quality)
268
+ end
269
+
270
+ def test_sampling_factor
271
+ assert_nothing_raised { @info.sampling_factor = '2x1' }
272
+ assert_equal('2x1', @info.sampling_factor)
273
+ end
274
+
275
+ def test_server_name
276
+ assert_nothing_raised { @info.server_name = 'foo' }
277
+ assert_equal('foo', @info.server_name)
278
+ end
279
+
280
+ def test_size
281
+ assert_nothing_raised { @info.size = '200x100' }
282
+ assert_equal('200x100', @info.size)
283
+ assert_nothing_raised { @info.size = Magick::Geometry.new(100,200) }
284
+ assert_equal('100x200', @info.size)
285
+ end
286
+
287
+ def test_stroke
288
+ assert_nothing_raised { @info.stroke }
289
+ assert_nil(@info.stroke)
290
+
291
+ assert_nothing_raised { @info.stroke = 'white' }
292
+ assert_equal('white', @info.stroke)
293
+
294
+ assert_nothing_raised { @info.stroke = nil }
295
+ assert_nil(@info.stroke)
296
+
297
+ assert_raise(ArgumentError) { @info.stroke = 'xxx' }
298
+ end
299
+
300
+ def test_stroke_width
301
+ assert_nothing_raised { @info.stroke_width = 10 }
302
+ assert_equal(10, @info.stroke_width)
303
+ assert_nothing_raised { @info.stroke_width = 5.25 }
304
+ assert_equal(5.25, @info.stroke_width)
305
+ assert_nothing_raised { @info.stroke_width = nil }
306
+ assert_equal(nil, @info.stroke_width)
307
+ end
308
+
309
+ def test_texture
310
+ img = Magick::Image.read('granite:') {self.size = '20x20' }
311
+ assert_nothing_raised { @info.texture = img.first }
312
+ end
313
+
314
+ def test_tile_offset
315
+ assert_nothing_raised { @info.tile_offset = '200x100' }
316
+ assert_equal('200x100', @info.tile_offset)
317
+ assert_nothing_raised { @info.tile_offset = Magick::Geometry.new(100,200) }
318
+ assert_equal('100x200', @info.tile_offset)
319
+ end
320
+
321
+ def test_undercolor
322
+ assert_nothing_raised { @info.undercolor }
323
+ assert_nil(@info.undercolor)
324
+
325
+ assert_nothing_raised { @info.undercolor = 'white' }
326
+ assert_equal('white', @info.undercolor)
327
+
328
+ assert_nothing_raised { @info.undercolor = nil }
329
+ assert_nil(@info.undercolor)
330
+
331
+ assert_raise(ArgumentError) { @info.undercolor = 'xxx' }
332
+ end
333
+
334
+ def test_units
335
+ Magick::ResolutionType.values.each do |v|
336
+ assert_nothing_raised { @info.units = v }
337
+ assert_equal(v, @info.units)
338
+ end
339
+ end
340
+
341
+ def test_view
342
+ assert_nothing_raised { @info.view = 'string' }
343
+ assert_equal('string', @info.view)
344
+ end
345
345
  end