Add tests for the constructor & store.

This commit is contained in:
Akinori MUSHA 2013-04-14 12:19:11 +09:00
parent c9a8e29202
commit 655fc9eb56

View file

@ -2,6 +2,24 @@ require File.expand_path('helper', File.dirname(__FILE__))
require 'tmpdir'
module TestHTTPCookieJar
class TestBasic < Test::Unit::TestCase
def test_store
jar = HTTP::CookieJar.new(:store => :hash)
assert_instance_of HTTP::CookieJar::HashStore, jar.store
assert_raises(IndexError) {
jar = HTTP::CookieJar.new(:store => :nonexistent)
}
jar = HTTP::CookieJar.new(:store => HTTP::CookieJar::HashStore.new)
assert_instance_of HTTP::CookieJar::HashStore, jar.store
assert_raises(TypeError) {
jar = HTTP::CookieJar.new(:store => HTTP::CookieJar::HashStore)
}
end
end
module Tests
def setup(options = nil, options2 = nil)
default_options = {