mirror of
https://github.com/sdsykes/fastimage.git
synced 2025-11-22 00:05:56 -05:00
Merge branch 'master' of https://github.com/sdsykes/fastimage
This commit is contained in:
commit
9069b53408
@ -1,4 +1,4 @@
|
||||
Copyright (c) 2008-2011 Stephen Sykes
|
||||
Copyright (c) 2008-2013 Stephen Sykes
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@ -173,6 +173,8 @@ class FastImage
|
||||
end
|
||||
end
|
||||
|
||||
uri.rewind if uri.respond_to?(:rewind)
|
||||
|
||||
raise SizeNotFound if options[:raise_on_failure] && @property == :size && !@size
|
||||
|
||||
rescue Timeout::Error, SocketError, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ECONNRESET,
|
||||
|
||||
@ -124,6 +124,15 @@ class FastImageTest < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_report_size_correctly_on_io_object_twice
|
||||
GoodFixtures.each do |fn, info|
|
||||
File.open(File.join(FixturePath, fn), "r") do |io|
|
||||
assert_equal info[1], FastImage.size(io)
|
||||
assert_equal info[1], FastImage.size(io)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_should_report_size_correctly_for_local_files_with_path_that_has_spaces
|
||||
Dir.chdir(PathHere) do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user