Package: ruby-fastimage / 2.1.4-1

0001-Drop-some-tests-which-need-network-connectivity.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Mon, 3 Nov 2014 15:58:36 +0900
Subject: Drop some tests which need network connectivity

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
 test/test.rb | 36 ++++++++++--------------------------
 1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/test/test.rb b/test/test.rb
index 51efd28..80daa56 100644
--- a/test/test.rb
+++ b/test/test.rb
@@ -53,12 +53,9 @@ TestUrl = "http://example.nowhere/"
 
 # this image fetch allows me to really test that fastimage is truly fast
 # but it's not ideal relying on external resources and connectivity speed
-LargeImage = "http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
-LargeImageInfo = [:jpeg, [9545, 6623]]
-LargeImageFetchLimit = 2  # seconds
-
-HTTPSImage = "https://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
-HTTPSImageInfo = [:jpeg, [9545, 6623]]
+# LargeImage = "http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
+# LargeImageInfo = [:jpeg, [9545, 6623]]
+# LargeImageFetchLimit = 2  # seconds
 
 DataUriImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAABCAYAAAD0In+KAAAAD0lEQVR42mNk+M9QzwAEAAmGAYCF+yOnAAAAAElFTkSuQmCC"
 DataUriImageInfo = [:png, [2, 1]]
@@ -268,19 +265,6 @@ class FastImageTest < Test::Unit::TestCase
     FakeWeb.register_uri(:get, from, :response=>resp)
   end
 
-  def test_should_fetch_info_of_large_image_faster_than_downloading_the_whole_thing
-    time = Time.now
-    size = FastImage.size(LargeImage)
-    size_time = Time.now
-    assert size_time - time < LargeImageFetchLimit
-    assert_equal LargeImageInfo[1], size
-    time = Time.now
-    type = FastImage.type(LargeImage)
-    type_time = Time.now
-    assert type_time - time < LargeImageFetchLimit
-    assert_equal LargeImageInfo[0], type
-  end
-
   # This test doesn't actually test the proxy function, but at least
   # it excercises the code. You could put anything in the http_proxy and it would still pass.
   # Any ideas on how to actually test this?
@@ -300,10 +284,10 @@ class FastImageTest < Test::Unit::TestCase
     assert_equal actual_size, size
   end
 
-  def test_should_handle_https_image
-    size = FastImage.size(HTTPSImage)
-    assert_equal HTTPSImageInfo[1], size
-  end
+  # def test_should_handle_https_image
+  #   size = FastImage.size(HTTPSImage)
+  #   assert_equal HTTPSImageInfo[1], size
+  # end
 
   require 'pathname'
   def test_should_handle_pathname
@@ -404,9 +388,9 @@ class FastImageTest < Test::Unit::TestCase
     end
   end
 
-  def test_should_work_with_domains_with_underscores
-    assert_equal :gif, FastImage.type("http://foo_bar.switchstep.com/images/p.gif")
-  end
+  # def test_should_work_with_domains_with_underscores
+  #   assert_equal :gif, FastImage.type("http://foo_bar.switchstep.com/images/p.gif")
+  # end
 
   def test_should_return_content_length_for_data_uri_images
     assert_equal DataUriImageContentLength, FastImage.new(DataUriImage).content_length