diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-12 10:10:15 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-12 10:10:15 +0000 |
commit | 1f136bffe6de68fd231a060d275223fb45f4d28a (patch) | |
tree | 6a9968e1cc37176c9b116d530df0843f0d157704 /spec/rubyspec | |
parent | 683b89070ebd3053a9317230274c279e32862187 (diff) | |
download | ruby-1f136bffe6de68fd231a060d275223fb45f4d28a.tar.gz |
Skip specs which make non-socket fd nonblocking on Windows
because Windows does not support nonblocking mode except sockets.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec')
-rw-r--r-- | spec/rubyspec/optional/capi/io_spec.rb | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/spec/rubyspec/optional/capi/io_spec.rb b/spec/rubyspec/optional/capi/io_spec.rb index 66bbc98a42..a0bcc9ef15 100644 --- a/spec/rubyspec/optional/capi/io_spec.rb +++ b/spec/rubyspec/optional/capi/io_spec.rb @@ -251,29 +251,31 @@ describe "C-API IO function" do 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 - @o.rb_io_wait_readable(@r_io, true).should be_true - @o.instance_variable_get(:@read_data).should == "rb_io_wait_re" + Thread.pass until thr.alive? - thr.join + @o.rb_io_wait_readable(@r_io, true).should be_true + @o.instance_variable_get(:@read_data).should == "rb_io_wait_re" + + thr.join + end end end |