mirror of
https://github.com/sdsykes/fastimage.git
synced 2025-10-18 00:00:52 -04:00
Work around for ruby 1.8.7p248 bug in net/http
This commit is contained in:
parent
304b99d5c6
commit
01d2005b4b
@ -147,6 +147,8 @@ class FastImage
|
|||||||
raise ImageFetchFailure if options[:raise_on_failure]
|
raise ImageFetchFailure if options[:raise_on_failure]
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
raise ImageFetchFailure if options[:raise_on_failure]
|
raise ImageFetchFailure if options[:raise_on_failure]
|
||||||
|
rescue NoMethodError # 1.8.7p248 can raise this due to a net/http bug
|
||||||
|
raise ImageFetchFailure if options[:raise_on_failure]
|
||||||
rescue UnknownImageType
|
rescue UnknownImageType
|
||||||
raise UnknownImageType if options[:raise_on_failure]
|
raise UnknownImageType if options[:raise_on_failure]
|
||||||
end
|
end
|
||||||
|
@ -74,6 +74,12 @@ class FastImageTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_should_raise_when_asked_to_when_domain_does_not_exist
|
||||||
|
assert_raises(FastImage::ImageFetchFailure) do
|
||||||
|
FastImage.size("http://www.google.com/does_not_exist_at_all", :raise_on_failure=>true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_should_raise_when_asked_when_image_type_not_known
|
def test_should_raise_when_asked_when_image_type_not_known
|
||||||
assert_raises(FastImage::UnknownImageType) do
|
assert_raises(FastImage::UnknownImageType) do
|
||||||
FastImage.size(TestUrl + "test.ico", :raise_on_failure=>true)
|
FastImage.size(TestUrl + "test.ico", :raise_on_failure=>true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user