Skip to content

Commit

Permalink
Fix test that only runs on 2.7
Browse files Browse the repository at this point in the history
2.6 cannot use kwargs **h to merge string-keyed hashes.

Fixes ruby#32
  • Loading branch information
headius committed Nov 23, 2022
1 parent a390f83 commit 9cab3c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/cgi/test_cgi_cookie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ def test_cgi_cookie_new_complex

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({'domain'=>'a.example.com', **h})
assert_equal('a.example.com', cookie.domain)

cookie = CGI::Cookie.new('domain'=>'1.example.com', **h)
cookie = CGI::Cookie.new({'domain'=>'1.example.com', **h})
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({'domain'=>'-a.example.com', **h})
}

assert_raise(ArgumentError) {
CGI::Cookie.new('domain'=>'a-.example.com', **h)
CGI::Cookie.new({'domain'=>'a-.example.com', **h})
}
end

Expand Down

0 comments on commit 9cab3c5

Please sign in to comment.