Sha256: b4d36eab87693b72605d84ff5b040a04e18080cd24c671c0cdcc6452281274c8

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

require_relative '../test-util'

class TestLocation < Location::DataLocation
  set_scheme "test"
end

describe 'Location::BasicLocation' do
  it 'should get by Location[]' do
    Location["test:/a"].should.kind_of TestLocation
  end

  it 'should raise an exception when the URI is unknown' do
    should.raise(ArgumentError) {Location["testa:/a"]}
  end

  it 'should be equal' do
    Location["test:/a"].should == Location["test:/a"]
  end

  it 'should be not equal' do
    Location["test:/a"].should != Location["test:/a/"]
  end

  it 'should be as directory' do
    Location["test:/a"].as_directory.path.should == Pathname.new("/a/")
  end

  it 'should be append' do
    (Location["test:/a/b"] + "c").path.should == Pathname.new("/a/b/c")
  end

  it 'should get basename' do
    Location["test:/a/name"].basename.should == "name"
  end

  it 'should get extension name' do
    Location["test:/a/name.txt"].extname.should == ".txt"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pione-0.2.2 test/location/spec_basic-location.rb