diff options
Diffstat (limited to 'spec/httpunix_spec.rb')
-rw-r--r-- | spec/httpunix_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/httpunix_spec.rb b/spec/httpunix_spec.rb index 5f31f6e..0fcff4a 100644 --- a/spec/httpunix_spec.rb +++ b/spec/httpunix_spec.rb @@ -25,9 +25,21 @@ class HTTPUNIXServer < WEBrick::HTTPServer @listeners << server end + # Workaround: + # https://bugs.ruby-lang.org/issues/10956 + # Affecting Ruby 2.2 + # Fix for 2.2 is at https://github.com/ruby/ruby/commit/ab0a64e1 + # However, this doesn't work with 2.1. The following should work for both: def start(&block) - setup_shutdown_pipe - super.start(&block) + @shutdown_pipe = IO.pipe + shutdown_pipe = @shutdown_pipe + super(&block) + end + + def cleanup_shutdown_pipe(shutdown_pipe) + @shutdown_pipe = nil + return if !shutdown_pipe + super(shutdown_pipe) end end |