From af609a1f90009d7f7c286b934ac57c1d7d1734f1 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:55:57 -0300 Subject: [PATCH] Exclude UNIXSocket tests under Windows --- test/test_integration.rb | 4 ++-- test/test_unix_socket.rb | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_integration.rb b/test/test_integration.rb index ece2c21e..b56e1873 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -1,5 +1,5 @@ +require "rbconfig" require 'test/unit' -require 'rubygems' require 'socket' require 'puma/cli' @@ -19,7 +19,7 @@ class TestIntegration < Test::Unit::TestCase end def test_stop_via_pumactl - if defined? JRUBY_VERSION + if defined?(JRUBY_VERSION) || RbConfig::CONFIG["host_os"] =~ /mingw|mswin/ assert true return end diff --git a/test/test_unix_socket.rb b/test/test_unix_socket.rb index 1204c8df..f649104f 100644 --- a/test/test_unix_socket.rb +++ b/test/test_unix_socket.rb @@ -1,10 +1,12 @@ +require "rbconfig" require 'test/unit' require 'puma/server' require 'socket' # UNIX sockets are not recommended on JRuby -unless defined?(JRUBY_VERSION) +# (or Windows) +unless defined?(JRUBY_VERSION) || RbConfig::CONFIG["host_os"] =~ /mingw|mswin/ class TestPumaUnixSocket < Test::Unit::TestCase App = lambda { |env| [200, {}, ["Works"]] } @@ -34,4 +36,4 @@ unless defined?(JRUBY_VERSION) sock.close end end -end \ No newline at end of file +end