Sha256: 405facef9eb1487c63dfb9879da50a0ae2e2a5e28d65f6c5237a8592ad964f97

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

require 'pione/test-helper'
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

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 test/location/spec_local-location.rb
pione-0.5.0.alpha.2 test/location/spec_local-location.rb
pione-0.5.0.alpha.1 test/location/spec_local-location.rb
pione-0.4.2 test/location/spec_local-location.rb
pione-0.4.1 test/location/spec_local-location.rb
pione-0.4.0 test/location/spec_local-location.rb
pione-0.3.2 test/location/spec_local-location.rb
pione-0.3.1 test/location/spec_local-location.rb
pione-0.3.0 test/location/spec_local-location.rb