Sha256: c4955df213577a8cac16d05aaf51b4c46bf3a1cf266310054aabbf2c3a44d081

Contents?: true

Size: 656 Bytes

Versions: 83

Compression:

Stored size: 656 Bytes

Contents

require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper'
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/common'

describe "Dir.entries" do
  it "returns an Array of filenames in an existing directory including dotfiles" do
    a = Dir.entries(DirSpecs.mock_dir).sort

    a.should == DirSpecs.expected_paths

    a = Dir.entries("#{DirSpecs.mock_dir}/deeply/nested").sort
    a.should == %w|. .. .dotfile.ext directory|
  end
  
  it "raises a SystemCallError if called with a nonexistent diretory" do
    lambda { Dir.entries DirSpecs.nonexistent }.should raise_error(SystemCallError)
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-1.4.2 spec/framework_spec/app/spec/core/dir/entries_spec.rb
rhodes-1.4.1 spec/framework_spec/app/spec/core/dir/entries_spec.rb
rhodes-1.4.0 spec/framework_spec/app/spec/core/dir/entries_spec.rb