Sha256: d1d56f7ae98641a92eceb277a0f1dda3c0002a9ef7e02cc26364ee9af7f5992a
Contents?: true
Size: 1.23 KB
Versions: 83
Compression:
Stored size: 1.23 KB
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes' describe "IO#sync=" do before :each do @io = File.open(File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/readlines.txt') end after :each do @io.close unless @io.closed? end it "sets the sync mode to true or false" do @io.sync = true @io.sync.should == true @io.sync = false @io.sync.should == false end it "accepts non-boolean arguments" do @io.sync = 10 @io.sync.should == true @io.sync = nil @io.sync.should == false @io.sync = Object.new @io.sync.should == true end it "raises IOError on closed stream" do lambda { IOSpecs.closed_file.sync = true }.should raise_error(IOError) end end describe "IO#sync" do before :each do @io = File.open(File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/readlines.txt') end after :each do @io.close unless @io.closed? end it "returns the current sync mode" do @io.sync.should == false end it "raises IOError on closed stream" do lambda { IOSpecs.closed_file.sync }.should raise_error(IOError) end end
Version data entries
83 entries across 83 versions & 1 rubygems