Sha256: a22f7b93c124bb86a03ea778fb69e0ee88cf07bfbb3969b5528d0186cd9a9e92

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require_relative '../test-util'
require_relative 'location-behavior'

describe 'Location::LocalLocation' do
  before do
    @file = Location[Temppath.create]
    @dir = Location[Temppath.create]
    (@dir + "A").create("A")
    (@dir + "B").create("B")
    (@dir + "C").create("C")
    (@dir + "D" + "X").create("X")
    (@dir + "D" + "Y").create("Y")
    (@dir + "D" + "Z").create("Z")
  end

  after do
    @file.delete
    @dir.delete
  end

  behaves_like "location"

  it "should be symbolic link" do
    desc = Location[Temppath.create].tap {|x| x.create("A")}
    @file.link(desc)
    @file.read.should == "A"
    @file.path.ftype.should == "link"
  end

  it 'should local copy' do
    dest = Location[Temppath.create]
    @file.create("A")
    @file.copy(dest)
    dest.read.should == "A"
    dest.path.ftype.should == "file"
    @file.read.should == "A"
    @file.path.ftype.should == "file"
  end

  it 'should local turn' do
    dest = Location[Temppath.create]
    @file.create("A")
    @file.turn(dest)
    dest.read.should == "A"
    dest.path.ftype.should == "file"
    @file.read.should == "A"
    @file.path.ftype.should == "link"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pione-0.2.2 test/location/spec_local-location.rb
pione-0.2.1 test/location/spec_local-location.rb
pione-0.2.0 test/location/spec_local-location.rb