Sha256: 2b4f7fab1c9982843d9a05d0e9e6a780d894a82b387b104f5ef2d684c01c884b
Contents?: true
Size: 865 Bytes
Versions: 83
Compression:
Stored size: 865 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/common' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/shared/closed' describe "Dir#rewind" do before(:each) do @dir = Dir.open DirSpecs.mock_dir end after(:each) do @dir.close end it "resets the next read to start from the first entry" do first = @dir.pos a = @dir.read b = @dir.read prejmp = @dir.pos ret = @dir.rewind second = @dir.pos c = @dir.read a.should_not == b b.should_not == c c.should == a second.should_not == prejmp end it "returns the Dir instance" do @dir.rewind.should == @dir end end describe "Dir#rewind" do it_behaves_like :dir_closed, :rewind end
Version data entries
83 entries across 83 versions & 1 rubygems