Tests: added Ruby tests with array in header values
This commit is contained in:
committed by
andrey-zelenkov
parent
a1e00b4e28
commit
4e08f49549
7
test/ruby/header_array/config.ru
Normal file
7
test/ruby/header_array/config.ru
Normal file
@@ -0,0 +1,7 @@
|
||||
app = Proc.new do |env|
|
||||
['200', {
|
||||
'x-array' => ['name=value', '', 'value', 'av'],
|
||||
}, []]
|
||||
end
|
||||
|
||||
run app
|
||||
7
test/ruby/header_array_empty/config.ru
Normal file
7
test/ruby/header_array_empty/config.ru
Normal file
@@ -0,0 +1,7 @@
|
||||
app = Proc.new do |env|
|
||||
['200', {
|
||||
'x-array' => [],
|
||||
}, []]
|
||||
end
|
||||
|
||||
run app
|
||||
7
test/ruby/header_array_nil/config.ru
Normal file
7
test/ruby/header_array_nil/config.ru
Normal file
@@ -0,0 +1,7 @@
|
||||
app = Proc.new do |env|
|
||||
['200', {
|
||||
'x-array' => [nil],
|
||||
}, []]
|
||||
end
|
||||
|
||||
run app
|
||||
@@ -309,6 +309,26 @@ def test_ruby_application_header_status():
|
||||
assert client.get()['status'] == 200, 'header status'
|
||||
|
||||
|
||||
def test_ruby_application_header_array():
|
||||
client.load('header_array')
|
||||
|
||||
assert client.get()['headers']['x-array'] == 'name=value; ; value; av'
|
||||
|
||||
|
||||
def test_ruby_application_header_array_nil():
|
||||
client.load('header_array_nil')
|
||||
|
||||
assert client.get()['status'] == 503
|
||||
|
||||
|
||||
def test_ruby_application_header_array_empty():
|
||||
client.load('header_array_empty')
|
||||
|
||||
headers = client.get()['headers']
|
||||
assert 'x-array' in headers
|
||||
assert headers['x-array'] == ''
|
||||
|
||||
|
||||
@pytest.mark.skip('not yet')
|
||||
def test_ruby_application_header_rack():
|
||||
client.load('header_rack')
|
||||
|
||||
Reference in New Issue
Block a user