Sha256: 04d83d0bca8c34c4c6743472ac8f573aef61b781a17b4a125fbc5153dd7f3835

Contents?: true

Size: 954 Bytes

Versions: 11

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

describe 'Container' do
  with_test_dir

  it "should threat paths as UniversalEntry except it ends with '/'" do
    test_dir.should_receive(:entry).with('tmp/a/b')
    test_dir['tmp/a/b']

    test_dir.should_receive(:dir).with('tmp/a/b')
    test_dir['tmp/a/b/']
  end

  it '/' do
    test_dir[:some_path].should == test_dir / :some_path
    test_dir[:some_path][:another_path].should == test_dir / :some_path / :another_path
  end

  it "UniversalEntry should be wrapped inside of proxy, Dir and File should not" do
    -> {test_dir.dir.proxy?}.should raise_error(NoMethodError)
    -> {test_dir.file.proxy?}.should raise_error(NoMethodError)
    test_dir.entry.proxy?.should be_true
  end

  it "sometimes it also should inexplicitly guess that path is a Dir instead of UniversalEntry (but still wrap it inside of Proxy)" do

    dir = test_dir['tmp/a/..']
    dir.proxy?.should be_true
    dir.should be_a(Vfs::Dir)
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
vfs-momolog-0.0.1 spec/container_spec.rb
vfs-0.4.8 spec/container_spec.rb
vfs-0.4.7 spec/container_spec.rb
vfs-0.4.6 spec/container_spec.rb
vfs-0.4.5 spec/container_spec.rb
vfs-0.4.4 spec/container_spec.rb
vfs-0.4.3 spec/container_spec.rb
vfs-0.4.2 spec/container_spec.rb
vfs-0.4.1 spec/container_spec.rb
vfs-0.4.0 spec/container_spec.rb
io-0.0.1 spec/container_spec.rb