Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It was a bit of a mess. Much of the code was unnecessary, dating from before 2.0 when it used Net::SFTP instead of Net::SSH2. As a result, the error handling was all wrong. While at it, remove the file name escaping, as with newer versions of Net::SSH2 at least (or perhaps newer versions of libssh2), it was leaving the backslashes in the file names on the destination server. So bump up the minimum version of Net::SSH2. For sanity, also add tests to make sure that Net::Util::Trans::SFTP and Net::Util::Trans::SFTP compile and have apprpropriate interfaces.
- Loading branch information
Showing
5 changed files
with
152 additions
and
122 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package Bric::Util::Trans::FTP::Test; | ||
use strict; | ||
use warnings; | ||
use base qw(Bric::Test::Base); | ||
use Test::More; | ||
use Bric::Util::ApacheUtil qw(unescape_uri escape_uri); | ||
use File::Spec::Functions qw(catdir); | ||
use File::Spec::Unix; | ||
|
||
############################################################################## | ||
# Test class loading. | ||
############################################################################## | ||
sub _test_load : Test(3) { | ||
use_ok('Bric::Util::Trans::FTP'); | ||
isa_ok 'Bric::Util::Trans::FTP', 'Bric'; | ||
|
||
can_ok 'Bric::Util::Trans::FTP', qw( | ||
new | ||
put_res | ||
del_res | ||
); | ||
} | ||
|
||
1; | ||
__END__ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package Bric::Util::Trans::SFTP::Test; | ||
use strict; | ||
use warnings; | ||
use base qw(Bric::Test::Base); | ||
use Test::More; | ||
use Bric::Util::ApacheUtil qw(unescape_uri escape_uri); | ||
use File::Spec::Functions qw(catdir); | ||
use File::Spec::Unix; | ||
|
||
############################################################################## | ||
# Test class loading. | ||
############################################################################## | ||
sub _test_load : Test(3) { | ||
use_ok('Bric::Util::Trans::SFTP'); | ||
isa_ok 'Bric::Util::Trans::SFTP', 'Bric'; | ||
|
||
can_ok 'Bric::Util::Trans::SFTP', qw( | ||
new | ||
put_res | ||
del_res | ||
_connect_to | ||
); | ||
} | ||
|
||
1; | ||
__END__ |