Sha256: d214ef804b831236d2f451357415f8db6d4eb4ff5d1a50f2b1b147f96c57b68d

Contents?: true

Size: 867 Bytes

Versions: 13

Compression:

Stored size: 867 Bytes

Contents

require 'spec_helper'

describe 'Container' do
  before do
    @fs = '/'.to_entry_on(Vfs::Storages::HashFs.new)
  end
  
  it "should threat paths as UniversalEntry except it ends with '/'" do
    @fs.should_receive(:entry).with('/a/b')
    @fs['/a/b']
    
    @fs.should_receive(:dir).with('/a/b')
    @fs['/a/b/']
  end
  
  it '/' do
    @fs[:some_path].should == @fs / :some_path
  end
  
  it "UniversalEntry should be wrapped inside of proxy, Dir and File should not" do
    -> {@fs.dir.proxy?}.should raise_error(NoMethodError)
    -> {@fs.file.proxy?}.should raise_error(NoMethodError)
    @fs.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 = @fs['/a/..']
    dir.proxy?.should be_true
    dir.should be_a(Vfs::Dir)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vfs-0.3.10 spec/container_spec.rb
vfs-0.3.9 spec/container_spec.rb
vfs-0.3.8 spec/container_spec.rb
vfs-0.3.7 spec/container_spec.rb
vfs-0.3.6 spec/container_spec.rb
vfs-0.3.5 spec/container_spec.rb
vfs-0.3.4 spec/container_spec.rb
vfs-0.3.3 spec/container_spec.rb
vfs-0.3.2 spec/container_spec.rb
vfs-0.3.1 spec/container_spec.rb
vfs-0.3 spec/container_spec.rb
vfs-0.2.1 spec/container_spec.rb
vfs-0.2 spec/container_spec.rb