Sha256: d144be5cadbf5022ea938f590a8b226aae947e413a25ec2abe2ca559035fe100

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

#!/usr/local/bin/ruby
if $0 == __FILE__
  Dir.chdir File.dirname(__FILE__)+'/../'
  $:.unshift File.expand_path('../lib/')
end

require 'rio'
require 'tc/testcase'
require 'open-uri'
require 'ftp/testdef'

class TC_ftp2ftp < Test::RIO::TestCase
  @@once = false
  include Test::RIO::FTP::Const

  def self.once
    @@once = true
  end
  def setup
    super
    self.class.once unless @@once
    FS_RWROOT.entries { |ent| ent.delete! }
  end
  def test_cp_ro2rw_file1
    fname = 'f0'
    src = FTP_ROROOT/fname
    dst = FTP_RWROOT/fname
    dst < src
    assert_equal(src.contents,dst.contents)
  end
  def test_cp_ro2rw_file2
    fname = 'f0'
    src = FTP_ROROOT/fname
    dst = FTP_RWROOT
    dst < src
    fdst = dst/fname
    assert_equal(src.contents,fdst.contents)
  end
  def test_cp_ro2rw_dir
    fname = 'd0'
    src = FTP_ROROOT/fname
    dst = FTP_RWROOT
    dst < src
    ans = rio(FTP_RWROOT,fname).to_a
    exp = rio(FTP_ROROOT,fname).to_a.map{ |s| s.sub('ro','rw') }
  
    assert_equal(smap(exp),smap(ans))
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rio-0.3.8 test/ftp/ftp2ftp.rb