summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@softwarelivre.org>2015-05-10 20:40:19 -0300
committerAntonio Terceiro <terceiro@softwarelivre.org>2015-05-10 20:41:41 -0300
commit4614e1fa4ff4cb5d7442f680a053298e0cc80819 (patch)
treeee38185edcad6f4aa89ab88a6dd863e81ab4f70c /test
parente6744a2aac310bff2680207845d121a42f04209b (diff)
downloadfeed2imap-4614e1fa4ff4cb5d7442f680a053298e0cc80819.tar.gz
feed2imap-4614e1fa4ff4cb5d7442f680a053298e0cc80819.tar.bz2
feed2imap-4614e1fa4ff4cb5d7442f680a053298e0cc80819.zip
Fix regression in `include-images` option
test/tc_httpfetcher.rb can't still be re-enabled because it hits the network, and a hostname that is no longer valid.
Diffstat (limited to 'test')
-rwxr-xr-xtest/tc_httpfetcher.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/test/tc_httpfetcher.rb b/test/tc_httpfetcher.rb
index d44b3ee..e904086 100755
--- a/test/tc_httpfetcher.rb
+++ b/test/tc_httpfetcher.rb
@@ -9,7 +9,7 @@ class HttpFetcherTest < Test::Unit::TestCase
def test_get_https
s = ''
assert_nothing_raised do
- s = HTTPFetcher::fetch('https://linuxfr.org/pub/', Time::at(0))
+ s = fetcher.fetch('https://linuxfr.org/pub/', Time::at(0))
end
assert(s.length > 20)
end
@@ -21,7 +21,7 @@ class HttpFetcherTest < Test::Unit::TestCase
def test_get_httpnotmodif
s = 'aaa'
assert_nothing_raised do
- s = HTTPFetcher::fetch('http://www.lucas-nussbaum.net/feed2imap_tests/notmodified.php', Time::new())
+ s = fetcher.fetch('http://www.lucas-nussbaum.net/feed2imap_tests/notmodified.php', Time::new())
end
assert_nil(s)
end
@@ -29,7 +29,7 @@ class HttpFetcherTest < Test::Unit::TestCase
def test_get_redir1
s = 'aaa'
assert_nothing_raised do
- s = HTTPFetcher::fetch("http://www.lucas-nussbaum.net/feed2imap_tests/redir.php?redir=#{MAXREDIR}", Time::at(0))
+ s = fetcher.fetch("http://www.lucas-nussbaum.net/feed2imap_tests/redir.php?redir=#{MAXREDIR}", Time::at(0))
end
assert_equal('OK', s)
end
@@ -37,14 +37,14 @@ class HttpFetcherTest < Test::Unit::TestCase
def test_get_redir2
s = ''
assert_raise(RuntimeError) do
- s = HTTPFetcher::fetch("http://www.lucas-nussbaum.net/feed2imap_tests/redir.php?redir=#{MAXREDIR + 1}", Time::at(0))
+ s = fetcher.fetch("http://www.lucas-nussbaum.net/feed2imap_tests/redir.php?redir=#{MAXREDIR + 1}", Time::at(0))
end
end
def test_httpauth
s = ''
assert_nothing_raised do
- s = HTTPFetcher::fetch("http://aaa:bbb@ensilinx1.imag.fr/~lucas/f2i_redirauth.php", Time::at(0))
+ s = fetcher.fetch("http://aaa:bbb@ensilinx1.imag.fr/~lucas/f2i_redirauth.php", Time::at(0))
end
assert_equal("Login: aaa / Password: bbb \n", s)
end
@@ -52,7 +52,7 @@ class HttpFetcherTest < Test::Unit::TestCase
def test_redirauth
s = ''
assert_nothing_raised do
- s = HTTPFetcher::fetch("http://aaa:bbb@ensilinx1.imag.fr/~lucas/f2i_redirauth.php?redir=1", Time::at(0))
+ s = fetcher.fetch("http://aaa:bbb@ensilinx1.imag.fr/~lucas/f2i_redirauth.php?redir=1", Time::at(0))
end
assert_equal("Login: aaa / Password: bbb \n", s)
end
@@ -60,7 +60,13 @@ class HttpFetcherTest < Test::Unit::TestCase
def test_notfound
s = ''
assert_raises(RuntimeError) do
- s = HTTPFetcher::fetch("http://ensilinx1.imag.fr/~lucas/notfound.html", Time::at(0))
+ s = fetcher.fetch("http://ensilinx1.imag.fr/~lucas/notfound.html", Time::at(0))
end
end
+
+ private
+
+ def fetcher
+ HTTPFetcher.new
+ end
end