Sha256: a029bbc9ec3d918a13c61f4ab2d2e73c5982d74c299c4d30faacbb313bf4062b

Contents?: true

Size: 876 Bytes

Versions: 1

Compression:

Stored size: 876 Bytes

Contents

require 'pathname'

describe "VFS path resolution" do

  describe "resolve_within_archive" do
    it "should return pathnames with vfs: prefix unmodified" do
      pathname = Pathname.new("vfs:/tmp/foo")
      path = VFS.resolve_within_archive(pathname)
      path.should == pathname.to_s
    end
  end

  describe "resolve_path_url" do
    it "should prefix relative paths with the current dir" do
      cwd = Dir.pwd
      path = VFS.resolve_path_url( "foo/bar" )
      path.should match /^vfs:#{cwd}\/foo\/bar$/
    end

    it "should not prefix absolute paths with the current dir" do
      path = VFS.resolve_path_url( "/foo/bar" )
      path.should match /^vfs:\/foo\/bar$/
    end

    it "should treat paths with windows drive letters as absolute" do
      path = VFS.resolve_path_url( "C:/foo/bar" )
      path.should match /^vfs:\/C:\/foo\/bar$/
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
org.torquebox.vfs-1.0.0.Beta23 spec/vfs_spec.rb