Sha256: e97eba6125185162eaab534e06104adff6b8cc480803fd8f9274118a7b68aeca

Contents?: true

Size: 998 Bytes

Versions: 3

Compression:

Stored size: 998 Bytes

Contents

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

Util::FTPServer.start(Util::FTPOnMemoryFS.new)

describe 'Location::FTPLocation' do
  before do
    Util::FTPServer.fs.clear
    @file = Util::FTPServer.make_location(Temppath.create)
    @dir = Util::FTPServer.make_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 get ftp location from myftp scheme URI" do
    location = Location[URI.parse("myftp://abc:123@myself/output/")]
    location.scheme.should == "ftp"
  end

  it "should move file in the ftp server" do
    location = Util::FTPServer.make_location(Temppath.create)
    (@dir + "A").move(location)
    location.should.exist
    location.read.should == "A"
    (@dir + "A").should.not.exist
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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