зеркало из https://github.com/github/ruby.git
[ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older rubies
https://github.com/ruby/cgi/commit/05f0c58048
This commit is contained in:
Родитель
d2fa67de81
Коммит
656f25987c
|
@ -62,18 +62,18 @@ class CGICookieTest < Test::Unit::TestCase
|
|||
|
||||
def test_cgi_cookie_new_with_domain
|
||||
h = {'name'=>'name1', 'value'=>'value1'}
|
||||
cookie = CGI::Cookie.new('domain'=>'a.example.com', **h)
|
||||
cookie = CGI::Cookie.new(h.merge('domain'=>'a.example.com'))
|
||||
assert_equal('a.example.com', cookie.domain)
|
||||
|
||||
cookie = CGI::Cookie.new('domain'=>'1.example.com', **h)
|
||||
cookie = CGI::Cookie.new(h.merge('domain'=>'1.example.com'))
|
||||
assert_equal('1.example.com', cookie.domain, 'enhanced by RFC 1123')
|
||||
|
||||
assert_raise(ArgumentError) {
|
||||
CGI::Cookie.new('domain'=>'-a.example.com', **h)
|
||||
CGI::Cookie.new(h.merge('domain'=>'-a.example.com'))
|
||||
}
|
||||
|
||||
assert_raise(ArgumentError) {
|
||||
CGI::Cookie.new('domain'=>'a-.example.com', **h)
|
||||
CGI::Cookie.new(h.merge('domain'=>'a-.example.com'))
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче