Sha256: cd24759668a009ed9e06a438b182b0b9f9fb48359dbb255f42fb007b148d0a6a

Contents?: true

Size: 1000 Bytes

Versions: 5

Compression:

Stored size: 1000 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'


require 'pathname'

describe "VFS path resolution" do

  extend PathHelper

  describe "resolve_within_archive" do
    it "should return pathnames with vfs: prefix unmodified" do
      pathname = Pathname.new("vfs:/tmp/foo")
      path = TorqueBox::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 = TorqueBox::VFS.resolve_path_url( "foo/bar" )
      path.should match /^#{vfs_path(cwd)}\/foo\/bar$/
    end

    it "should not prefix absolute paths with the current dir" do
      path = TorqueBox::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 = TorqueBox::VFS.resolve_path_url( "C:/foo/bar" )
      path.should match /^vfs:\/C:\/foo\/bar$/
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
torquebox-vfs-1.1.1-java spec/vfs_spec.rb
torquebox-vfs-1.0.1-java spec/vfs_spec.rb
torquebox-vfs-1.0.0-java spec/vfs_spec.rb
torquebox-vfs-1.0.0.CR2-java spec/vfs_spec.rb
torquebox-vfs-1.0.0.CR1-java spec/vfs_spec.rb