diff options
-rw-r--r-- | test/ruby/header_array/config.ru | 7 | ||||
-rw-r--r-- | test/ruby/header_array_empty/config.ru | 7 | ||||
-rw-r--r-- | test/ruby/header_array_nil/config.ru | 7 | ||||
-rw-r--r-- | test/test_ruby_application.py | 20 |
4 files changed, 41 insertions, 0 deletions
diff --git a/test/ruby/header_array/config.ru b/test/ruby/header_array/config.ru new file mode 100644 index 00000000..6401ab4b --- /dev/null +++ b/test/ruby/header_array/config.ru @@ -0,0 +1,7 @@ +app = Proc.new do |env| + ['200', { + 'x-array' => ['name=value', '', 'value', 'av'], + }, []] +end + +run app diff --git a/test/ruby/header_array_empty/config.ru b/test/ruby/header_array_empty/config.ru new file mode 100644 index 00000000..df40ffdd --- /dev/null +++ b/test/ruby/header_array_empty/config.ru @@ -0,0 +1,7 @@ +app = Proc.new do |env| + ['200', { + 'x-array' => [], + }, []] +end + +run app diff --git a/test/ruby/header_array_nil/config.ru b/test/ruby/header_array_nil/config.ru new file mode 100644 index 00000000..04550c8d --- /dev/null +++ b/test/ruby/header_array_nil/config.ru @@ -0,0 +1,7 @@ +app = Proc.new do |env| + ['200', { + 'x-array' => [nil], + }, []] +end + +run app diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index aae89999..127b75b7 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -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') |