features/support/test_client.rb in ftpd-0.0.0.pre2 vs features/support/test_client.rb in ftpd-0.0.1.pre
- old
+ new
@@ -5,18 +5,17 @@
extend Forwardable
include FileUtils
def initialize(opts = {})
- @temp_dir = Ftpd::TempDir.new
+ @temp_dir = TempDir.make
@ftp = make_ftp(opts)
@templates = TestFileTemplates.new
end
def close
@ftp.close
- @temp_dir.rm
end
def_delegators :@ftp,
:chdir,
:connect,
@@ -30,11 +29,11 @@
:passive=,
:pwd,
:quit
def raw(*command)
- @ftp.sendcmd *command.compact.join(' ')
+ @ftp.sendcmd command.compact.join(' ')
end
def get(mode, remote_path)
method = "get#{mode}file"
@ftp.send method, remote_path, local_path(remote_path)
@@ -64,10 +63,10 @@
def local_path(remote_path)
temp_path(File.basename(remote_path))
end
def temp_path(path)
- File.expand_path(path, @temp_dir.path)
+ File.expand_path(path, @temp_dir)
end
def make_ftp(opts)
tls = opts[:tls]
if tls