Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed all instances of `username' to `login'

  • Loading branch information...
commit 987a7678924f1683720085bb4accb13cfbf4a011 1 parent ad48871
@alanhaggai authored
Showing with 13 additions and 13 deletions.
  1. +7 −7 lib/WWW/Rapidshare/API.pm
  2. +6 −6 t/credentials.t
View
14 lib/WWW/Rapidshare/API.pm
@@ -26,7 +26,7 @@ my $ua = LWP::UserAgent->new();
$ua->env_proxy();
$ua->agent('WWW::Rapidshare::API');
-my ( $username, $password, $cookie );
+my ( $login, $password, $cookie );
=head1 SYNOPSIS
@@ -115,7 +115,7 @@ Incorrect parametres.
Correct usage:
credentials(
{
- username => \\w+,
+ login => \\w+,
password => \\w+,
cookie => \\w+
}
@@ -123,14 +123,14 @@ Correct usage:
USAGE
croak $error if ref( $_[0] ) ne 'HASH';
my %parametres = %{ $_[0] };
- if ( !( defined $parametres{username} && defined $parametres{password} )
+ if ( !( defined $parametres{login} && defined $parametres{password} )
|| !defined $parametres{cookie} )
{
croak $error;
}
- if ( defined $parametres{username} && defined $parametres{password} ) {
- $username = $parametres{username};
+ if ( defined $parametres{login} && defined $parametres{password} ) {
+ $login = $parametres{login};
$password = $parametres{password};
}
elsif ( defined $parametres{cookie} ) {
@@ -139,9 +139,9 @@ USAGE
}
sub storedcredentials {
- if ( defined $username && defined $password ) {
+ if ( defined $login && defined $password ) {
return (
- username => $username,
+ login => $login,
password => $password,
);
}
View
12 t/credentials.t
@@ -9,7 +9,7 @@ use WWW::Rapidshare::API;
throws_ok(
sub {
credentials(
- username => 'not_a_valid_user',
+ login => 'not_a_valid_user',
password => 'not_at_all_valid',
cookie => 'not_valid',
);
@@ -21,20 +21,20 @@ throws_ok(
sub {
credentials(
{
- username => undef,
+ login => undef,
password => 'not_at_all_valid',
cookie => undef,
}
);
},
qr/^Incorrect parametres/,
-'credentials() croaked, as expected, when both username and cookie are not provided'
+'credentials() croaked, as expected, when both login and cookie are not provided'
);
lives_ok(
sub {
credentials(
{
- username => 'not_a_valid_user',
+ login => 'not_a_valid_user',
password => 'not_at_all_valid',
cookie =>
'2AA928EE1DBA4AE093D872E578CEC9B106280FD1429D4A8C8FB72AE6ACEDC9C2A086C285F502F0FEE77567F6C9051BD1'
@@ -44,7 +44,7 @@ lives_ok(
'credentials() succeeded'
);
my %credentials = storedcredentials();
-is( $credentials{username}, 'not_a_valid_user',
- 'storedcredentials() returned username' );
+is( $credentials{login}, 'not_a_valid_user',
+ 'storedcredentials() returned login' );
is( $credentials{password}, 'not_at_all_valid',
'storedcredentials() returned password' );
Please sign in to comment.
Something went wrong with that request. Please try again.