ruby-changes:46568
From: usa <ko1@a...>
Date: Fri, 12 May 2017 19:10:20 +0900 (JST)
Subject: [ruby-changes:46568] usa:r58683 (trunk): Skip specs which make non-socket fd nonblocking on Windows
usa 2017-05-12 19:10:15 +0900 (Fri, 12 May 2017) New Revision: 58683 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58683 Log: Skip specs which make non-socket fd nonblocking on Windows because Windows does not support nonblocking mode except sockets. Modified files: trunk/spec/rubyspec/optional/capi/io_spec.rb Index: spec/rubyspec/optional/capi/io_spec.rb =================================================================== --- spec/rubyspec/optional/capi/io_spec.rb (revision 58682) +++ spec/rubyspec/optional/capi/io_spec.rb (revision 58683) @@ -251,29 +251,31 @@ describe "C-API IO function" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/io_spec.rb#L251 end end - describe "rb_io_wait_readable" do - it "returns false if there is no error condition" do - @o.rb_io_wait_readable(@r_io, false).should be_false - end - - it "raises and IOError if passed a closed stream" do - @r_io.close - lambda { @o.rb_io_wait_readable(@r_io, false) }.should raise_error(IOError) - end + platform_is_not :windows do + describe "rb_io_wait_readable" do + it "returns false if there is no error condition" do + @o.rb_io_wait_readable(@r_io, false).should be_false + end - it "blocks until the io is readable and returns true" do - @o.instance_variable_set :@write_data, false - thr = Thread.new do - sleep 0.1 until @o.instance_variable_get(:@write_data) - @w_io.write "rb_io_wait_readable" + it "raises and IOError if passed a closed stream" do + @r_io.close + lambda { @o.rb_io_wait_readable(@r_io, false) }.should raise_error(IOError) end - Thread.pass until thr.alive? + it "blocks until the io is readable and returns true" do + @o.instance_variable_set :@write_data, false + thr = Thread.new do + sleep 0.1 until @o.instance_variable_get(:@write_data) + @w_io.write "rb_io_wait_readable" + end + + Thread.pass until thr.alive? - @o.rb_io_wait_readable(@r_io, true).should be_true - @o.instance_variable_get(:@read_data).should == "rb_io_wait_re" + @o.rb_io_wait_readable(@r_io, true).should be_true + @o.instance_variable_get(:@read_data).should == "rb_io_wait_re" - thr.join + thr.join + end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/