mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-04-24 14:27:39 +00:00
Add tests for the constructor & store.
This commit is contained in:
parent
c9a8e29202
commit
655fc9eb56
1 changed files with 18 additions and 0 deletions
|
|
@ -2,6 +2,24 @@ require File.expand_path('helper', File.dirname(__FILE__))
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
|
|
||||||
module TestHTTPCookieJar
|
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
|
module Tests
|
||||||
def setup(options = nil, options2 = nil)
|
def setup(options = nil, options2 = nil)
|
||||||
default_options = {
|
default_options = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue