add Image#morphology_channel  test
@@ -107,6 +107,21 @@ class Image2_UT < Test::Unit::TestCase
assert_raise(ArgumentError) { @img.contrast_stretch_channel(25, 'x') }
end
+ def test_morphology_channel
+ assert_raise(ArgumentError) { @img.morphology_channel }
+ assert_raise(ArgumentError) { @img.morphology_channel(Magick::RedChannel) }
+ assert_raise(ArgumentError) { @img.morphology_channel(Magick::RedChannel, Magick::EdgeOutMorphology) }
+ assert_raise(ArgumentError) { @img.morphology_channel(Magick::RedChannel, Magick::EdgeOutMorphology, 2) }
+ assert_raise(ArgumentError) { @img.morphology_channel(Magick::RedChannel, Magick::EdgeOutMorphology, 2, :not_kernel_info) }
+
+ kernel = Magick::KernelInfo.new("Octagon")
+ assert_nothing_raised do
+ res = @img.morphology_channel(Magick::RedChannel, Magick::EdgeOutMorphology, 2, kernel)
+ assert_instance_of(Magick::Image, res)
+ assert_not_same(@img, res)
+ end
+ end
+
def test_convolve
kernel = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
order = 3
