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.
Files changed (4) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/fastimage.rb +1 -1
  3. data/test/test.rb +2 -0
  4. metadata +1 -1
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 2
3
3
  :major: 1
4
4
  :minor: 1
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] && !@type_only && !@size
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdsykes-fastimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Sykes