diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2018-03-21 18:26:40 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2018-03-21 18:26:40 +0300 |
commit | c7e67446a3054998893d64cbab150810d2a99aa5 (patch) | |
tree | 55e447f271a8553112d93149851b71a83eb5af43 /test/ruby/errors_write | |
parent | 37051b6c15cce7d6ab01c50e1086f8ef0b34e93d (diff) | |
download | unit-c7e67446a3054998893d64cbab150810d2a99aa5.tar.gz unit-c7e67446a3054998893d64cbab150810d2a99aa5.tar.bz2 |
Tests: Ruby module.
Diffstat (limited to '')
-rw-r--r-- | test/ruby/errors_write/config.ru | 6 | ||||
-rw-r--r-- | test/ruby/errors_write_int/config.ru | 6 | ||||
-rw-r--r-- | test/ruby/errors_write_to_s_custom/config.ru | 15 |
3 files changed, 27 insertions, 0 deletions
diff --git a/test/ruby/errors_write/config.ru b/test/ruby/errors_write/config.ru new file mode 100644 index 00000000..47619d6b --- /dev/null +++ b/test/ruby/errors_write/config.ru @@ -0,0 +1,6 @@ +app = Proc.new do |env| + env['rack.errors'].write('Error in application') + ['200', {'Content-Length' => '0'}, ['']] +end + +run app diff --git a/test/ruby/errors_write_int/config.ru b/test/ruby/errors_write_int/config.ru new file mode 100644 index 00000000..55d6c9d3 --- /dev/null +++ b/test/ruby/errors_write_int/config.ru @@ -0,0 +1,6 @@ +app = Proc.new do |env| + env['rack.errors'].write(1234567890) + ['200', {'Content-Length' => '0'}, ['']] +end + +run app diff --git a/test/ruby/errors_write_to_s_custom/config.ru b/test/ruby/errors_write_to_s_custom/config.ru new file mode 100644 index 00000000..9eb06d1a --- /dev/null +++ b/test/ruby/errors_write_to_s_custom/config.ru @@ -0,0 +1,15 @@ +app = Proc.new do |env| + + class Custom + def to_s() + nil + end + end + + e = Custom.new() + + env['rack.errors'].write(e) + ['200', {'Content-Length' => '0'}, ['']] +end + +run app |