1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-02-27 13:00:26 +01:00
parent dbea0be13d
commit 36dde35e02
48 changed files with 811 additions and 64 deletions

View file

@ -375,3 +375,29 @@ describe "rb_cloexec_open" do
@io.close_on_exec?.should be_true
end
end
describe "rb_io_t modes flags" do
before :each do
@o = CApiIOSpecs.new
@name = tmp("c_api_rb_io_specs")
touch @name
end
after :each do
rm_r @name
end
it "has the sync flag set if the IO object is synced in Ruby" do
File.open(@name) { |io|
io.sync = true
@o.rb_io_mode_sync_flag(io).should == true
}
end
it "has the sync flag unset if the IO object is not synced in Ruby" do
File.open(@name) { |io|
io.sync = false
@o.rb_io_mode_sync_flag(io).should == false
}
end
end