File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 381
381
@o = CApiIOSpecs . new
382
382
@name = tmp ( "c_api_rb_io_specs" )
383
383
touch @name
384
-
385
- @io = nil
386
384
end
387
385
388
386
after :each do
389
- @io . close unless @io . nil? || @io . closed?
390
387
rm_r @name
391
388
end
392
389
393
- it "Has the sync flag set if the IO object is synced in Ruby" do
394
- @io = File . open ( @name )
395
- @io . sync = true
396
- @o . rb_io_mode_sync_flag ( @io ) . should == true
390
+ it "has the sync flag set if the IO object is synced in Ruby" do
391
+ File . open ( @name ) { |io |
392
+ io . sync = true
393
+ @o . rb_io_mode_sync_flag ( io ) . should == true
394
+ }
397
395
end
398
396
399
- it "Has the sync flag unset if the IO object is not synced in Ruby" do
400
- @io = File . open ( @name )
401
- @io . sync = false
402
- @o . rb_io_mode_sync_flag ( @io ) . should == false
397
+ it "has the sync flag unset if the IO object is not synced in Ruby" do
398
+ File . open ( @name ) { |io |
399
+ io . sync = false
400
+ @o . rb_io_mode_sync_flag ( io ) . should == false
401
+ }
403
402
end
404
403
end
You can’t perform that action at this time.
0 commit comments