diff options
-rw-r--r-- | .gitlab-ci.yml | 22 | ||||
-rw-r--r-- | spec/httpunix_spec.rb | 17 |
2 files changed, 39 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 784e8d5..5f10abf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,5 @@ +image: "ruby:2.2" + before_script: - export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin - apt-get update @@ -6,6 +8,7 @@ before_script: - cp config.yml.example config.yml - bundle install +#ruby 2.2 rspec: script: - bundle exec rspec spec @@ -21,3 +24,22 @@ rubocop: - ruby except: - tags + +#ruby 2.1 +rspec:ruby2.1: + image: ruby:2.1 + script: + - bundle exec rspec spec + tags: + - ruby + except: + - tags + +rubocop:ruby2.1: + image: ruby:2.1 + script: + - bundle exec rubocop + tags: + - ruby + except: + - tags diff --git a/spec/httpunix_spec.rb b/spec/httpunix_spec.rb index cd2ede9..0fcff4a 100644 --- a/spec/httpunix_spec.rb +++ b/spec/httpunix_spec.rb @@ -24,6 +24,23 @@ class HTTPUNIXServer < WEBrick::HTTPServer socket.close @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) + @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 def tmp_socket_path |