features/support/test_client.rb in ftpd-0.3.2 vs features/support/test_client.rb in ftpd-0.4.0
- old
+ new
@@ -55,10 +55,14 @@
File.open(full_path, 'wb') do |file|
file.write @templates[File.basename(full_path)]
end
end
+ def template(path)
+ @templates[File.basename(path)]
+ end
+
def file_contents(path)
File.open(temp_path(path), 'rb', &:read)
end
def xpwd
@@ -68,9 +72,23 @@
def store_unique(local_path, remote_path)
command = ['STOU', remote_path].compact.join(' ')
File.open(temp_path(local_path), 'rb') do |file|
@ftp.storbinary command, file, Net::FTP::DEFAULT_BLOCKSIZE
+ end
+ end
+
+ def append_binary(local_path, remote_path)
+ command = ['APPE', remote_path].compact.join(' ')
+ File.open(temp_path(local_path), 'rb') do |file|
+ @ftp.storbinary command, file, Net::FTP::DEFAULT_BLOCKSIZE
+ end
+ end
+
+ def append_text(local_path, remote_path)
+ command = ['APPE', remote_path].compact.join(' ')
+ File.open(temp_path(local_path), 'rb') do |file|
+ @ftp.storlines command, file
end
end
private