features/support/test_client.rb in ftpd-0.2.1 vs features/support/test_client.rb in ftpd-0.2.2
- old
+ new
@@ -20,10 +20,11 @@
:chdir,
:connect,
:delete,
:getbinaryfile,
:gettextfile,
+ :help,
:login,
:ls,
:mkdir,
:nlst,
:noop,
@@ -50,20 +51,27 @@
def add_file(path)
full_path = temp_path(path)
mkdir_p File.dirname(full_path)
File.open(full_path, 'wb') do |file|
- file.puts @templates[File.basename(full_path)]
+ file.write @templates[File.basename(full_path)]
end
end
def file_contents(path)
File.open(temp_path(path), 'rb', &:read)
end
def xpwd
response = raw('XPWD')
response[/"(.+)"/, 1]
+ end
+
+ 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
private
RAW_METHOD_REGEX = /^send_(.*)$/