Sha256: 636cacc711c35a6f292df9eb7ecb56f4eded09210f40ddaacb9be0467768b925

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

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)
      pathname.vfs_path?.should be_true and path.should == "vfs:#{pathname}"
    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

1 entries across 1 versions & 1 rubygems

Version Path
torquebox-vfs-2.0.0.beta1-java spec/vfs_spec.rb