sdsykes-fastimage 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/fastimage.rb +1 -1
- data/test/test.rb +2 -0
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/fastimage.rb
CHANGED
@@ -142,7 +142,7 @@ class FastImage
|
|
142
142
|
else
|
143
143
|
fetch_using_open_uri
|
144
144
|
end
|
145
|
-
raise SizeNotFound if options[:raise_on_failure] &&
|
145
|
+
raise SizeNotFound if options[:raise_on_failure] && @property == :size && !@size
|
146
146
|
rescue Timeout::Error, SocketError, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNRESET, ImageFetchFailure
|
147
147
|
raise ImageFetchFailure if options[:raise_on_failure]
|
148
148
|
rescue Errno::ENOENT
|
data/test/test.rb
CHANGED
@@ -35,12 +35,14 @@ class FasImageTest < Test::Unit::TestCase
|
|
35
35
|
def test_should_report_type_correctly
|
36
36
|
GoodFixtures.each do |fn, info|
|
37
37
|
assert_equal info[0], FastImage.type(TestUrl + fn)
|
38
|
+
assert_equal info[0], FastImage.type(TestUrl + fn, :raise_on_failure=>true)
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
41
42
|
def test_should_report_size_correctly
|
42
43
|
GoodFixtures.each do |fn, info|
|
43
44
|
assert_equal info[1], FastImage.size(TestUrl + fn)
|
45
|
+
assert_equal info[1], FastImage.size(TestUrl + fn, :raise_on_failure=>true)
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|