diff --git a/lib/fastimage.rb b/lib/fastimage.rb index 72cbcb5..77a4b7e 100644 --- a/lib/fastimage.rb +++ b/lib/fastimage.rb @@ -436,8 +436,14 @@ class FastImage else raise UnknownImageType end - when " + + \ No newline at end of file diff --git a/test/test.rb b/test/test.rb index fd301fb..89b7192 100644 --- a/test/test.rb +++ b/test/test.rb @@ -37,7 +37,8 @@ GoodFixtures = { BadFixtures = [ "faulty.jpg", - "test_rgb.ct" + "test_rgb.ct", + "test.xml" ] # man.ico courtesy of http://www.iconseeker.com/search-icon/artists-valley-sample/business-man-blue.html # test_rgb.ct courtesy of http://fileformats.archiveteam.org/wiki/Scitex_CT @@ -122,6 +123,12 @@ class FastImageTest < Test::Unit::TestCase end end + def test_should_raise_unknown_image_typ_when_file_is_non_svg_xml + assert_raises(FastImage::UnknownImageType) do + FastImage.size(TestUrl + "test.xml", :raise_on_failure=>true) + end + end + def test_should_report_type_correctly_for_local_files GoodFixtures.each do |fn, info| assert_equal info[0], FastImage.type(File.join(FixturePath, fn))