test/test_eat.rb in eat-0.1.0 vs test/test_eat.rb in eat-0.1.1
- old
+ new
@@ -50,6 +50,24 @@
def test_limit_on_remote_files
assert_equal 'Use', eat(::URI.parse('http://brighterplanet.com/robots.txt'), :timeout => 10, :limit => 3)
assert_equal 'User-', eat(::URI.parse('http://brighterplanet.com/robots.txt'), :timeout => 10, :limit => 5)
end
+
+ def test_ssl
+ assert_nothing_raised do
+ eat 'https://brighterplanet.com'
+ end
+ end
+
+ def test_openssl_verify_on_by_default
+ assert_raises(OpenSSL::SSL::SSLError) do
+ eat 'https://foo.bar.brighterplanet.com'
+ end
+ end
+
+ def test_disable_openssl_verify
+ assert_nothing_raised do
+ eat 'https://foo.bar.brighterplanet.com', :openssl_verify_mode => 'none'
+ end
+ end
end