Created
January 28, 2010 01:34
-
-
Save harrisj/288345 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_dependency 'net/ftp' | |
class FTPMock | |
def gettextfile(remote_path, local_path) | |
test_file = File.join(RAILS_ROOT, 'test', 'data', 'dbready', remote_path) | |
if !File.exists?(test_file) | |
raise Net::FTPPermError, test_file + ' not found!' | |
end | |
FileUtils.cp test_file, local_path | |
end | |
def connect(host, port = FTP_PORT) | |
end | |
def open_socket(host, port) | |
end | |
def close | |
end | |
end | |
module Net | |
class FTPError < StandardError; end | |
class FTPReplyError < FTPError; end | |
class FTPTempError < FTPError; end | |
class FTPPermError < FTPError; end | |
class FTPProtoError < FTPError; end | |
class FTP | |
def self.open(*params) | |
FTPMock.new | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment