Permalink
Browse files

remove password field from examples and updated tests

  • Loading branch information...
1 parent 7a30afd commit e4ad14dc371fcff7681cd074a9f3f925f90818ce @barbie committed Sep 14, 2010
View
@@ -4,6 +4,8 @@
0.15 current
- added OAuth support to Identica access.
- added better protection for failing commands.
+ - removed password from example settings.
+ - updated tests.
0.14 11/09/2010
- documentation fix for INI format example (thanks to Alan Haggai Alavi).
View
@@ -1,6 +1,6 @@
{
"name": "App-Maisha",
- "version": "0.14",
+ "version": "0.15",
"abstract": "A command line social micro-blog networking tool.",
"author": [
"Barbie (BARBIE) <barbie@cpan.org>"
@@ -61,27 +61,27 @@
"provides": {
"App::Maisha": {
"file": "ib/App/Maisha.pm",
- "version": "0.14"
+ "version": "0.15"
},
"App::Maisha::Shell": {
"file": "lib/App/Maisha/Shell.pm",
- "version": "0.14"
+ "version": "0.15"
},
"App::Maisha::Plugin::Base": {
"file": "lib/App/Maisha/Plugin/Base.pm",
- "version": "0.14"
+ "version": "0.15"
},
"App::Maisha::Plugin::Identica": {
"file": "lib/App/Maisha/Plugin/Identica.pm",
- "version": "0.14"
+ "version": "0.15"
},
"App::Maisha::Plugin::Test": {
"file": "lib/App/Maisha/Plugin/Test.pm",
- "version": "0.14"
+ "version": "0.15"
},
"App::Maisha::Plugin::Twitter": {
"file": "lib/App/Maisha/Plugin/Twitter.pm",
- "version": "0.14"
+ "version": "0.15"
}
},
"no_index": {
View
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: App-Maisha
-version: 0.14
+version: 0.15
abstract: A command line social micro-blog networking tool.
author:
- Barbie <barbie@cpan.org>
@@ -37,22 +37,22 @@ build_requires:
provides:
App::Maisha:
file: lib/App/Maisha.pm
- version: 0.14
+ version: 0.15
App::Maisha::Shell:
file: lib/App/Maisha/Shell.pm
- version: 0.14
+ version: 0.15
App::Maisha::Plugin::Base:
file: lib/App/Maisha/Plugin/Base.pm
- version: 0.14
+ version: 0.15
App::Maisha::Plugin::Identica:
file: lib/App/Maisha/Plugin/Identica.pm
- version: 0.14
+ version: 0.15
App::Maisha::Plugin::Test:
file: lib/App/Maisha/Plugin/Test.pm
- version: 0.14
+ version: 0.15
App::Maisha::Plugin::Twitter:
file: lib/App/Maisha/Plugin/Twitter.pm
- version: 0.14
+ version: 0.15
no_index:
directory:
- t
View
@@ -4,8 +4,6 @@ tag: .
[Identica]
username: yourlogin
-password: yourpassword
[Twitter]
username: yourlogin
-password: yourpassword
View
@@ -1,5 +1,5 @@
{
"CONFIG": {"order": "asc","tag": "."},
- "Twitter": {"username": "yourlogin","password": "yourpassword"},
- "Identica":{"username": "yourlogin","password": "yourpassword"}
+ "Twitter": {"username": "yourlogin"},
+ "Identica":{"username": "yourlogin"}
}
View
@@ -1,5 +1,5 @@
{
CONFIG => {'order' => 'asc','tag' => '.'},
-# Twitter => {'test' => 1},
- Identica => {'username' => 'yourlogin','password' => 'yourpassword'},
+ Twitter => {'username' => 'yourlogin','test' => 1},
+ Identica => {'username' => 'yourlogin','test' => 1},
}
View
@@ -5,10 +5,8 @@
</CONFIG>
<Twitter>
<username>yourlogin</username>
- <password>yourpassword</password>
</Twitter>
<Identica>
<username>yourlogin</username>
- <password>yourpassword</password>
</Identica>
</xml>
View
@@ -5,8 +5,6 @@ CONFIG:
Twitter:
username: yourlogin
- password: yourpassword
Identica:
username: yourlogin
- password: yourpassword
View
@@ -3,7 +3,7 @@ package App::Maisha;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
#----------------------------------------------------------------------------
@@ -3,7 +3,7 @@ package App::Maisha::Plugin::Base;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
#----------------------------------------------------------------------------
# Public API
@@ -3,7 +3,7 @@ package App::Maisha::Plugin::Identica;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
#----------------------------------------------------------------------------
# Library Modules
@@ -81,8 +81,12 @@ sub login {
}
$self->api($api);
- print "...building user cache for Identica\n";
- $self->_build_users();
+
+ if(!$config->{test}) {
+ print "...building user cache for Identica\n";
+ $self->_build_users();
+ }
+
return 1;
}
@@ -3,7 +3,7 @@ package App::Maisha::Plugin::Test;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
#----------------------------------------------------------------------------
# Library Modules
@@ -3,7 +3,7 @@ package App::Maisha::Plugin::Twitter;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
#----------------------------------------------------------------------------
# Library Modules
@@ -90,8 +90,12 @@ sub login {
}
$self->api($api);
- print "...building user cache for Twitter\n";
- $self->_build_users();
+
+ if(!$config->{test}) {
+ print "...building user cache for Twitter\n";
+ $self->_build_users();
+ }
+
return 1;
}
View
@@ -3,7 +3,7 @@ package App::Maisha::Shell;
use strict;
use warnings;
-our $VERSION = '0.14';
+our $VERSION = '0.15';
#----------------------------------------------------------------------------
@@ -640,7 +640,7 @@ sub _command {
return unless(defined $service);
my $method = "api_$cmd";
- my $ret
+ my $ret;
eval { $ret = $service->$method(@_) };
if ($@) {
@@ -668,7 +668,7 @@ sub _commands {
$class =~ s/^App::Maisha::Plugin:://;
my $method = "api_$cmd";
- my $ret
+ my $ret;
eval { $ret = $service->$method(@_) };
if ($@) {
View
@@ -44,9 +44,9 @@ for my $k ( qw/
SKIP: {
ok( $obj->can($k), "$label can" )
or skip "'$k' attribute missing", 3;
- is( $obj->$k(), undef, "$label has no default" );
- is( $obj->$k(123), undef, "$label set" );
- is( $obj->$k, 123, "$label get" );
+ eval { is( $obj->$k(), undef, "$label has no default" ) };
+ eval { is( $obj->$k(123), undef, "$label set" ) };
+ eval { is( $obj->$k, 123, "$label get" ) };
};
}
View
@@ -15,8 +15,8 @@ BEGIN {
unless($nomock) {
$mock = Test::MockObject->new();
- $mock->fake_module( 'Net::Identica', 'update' => sub { return 1; } );
- $mock->fake_new( 'Net::Identica' );
+ $mock->fake_module( 'Net::Twitter', 'update' => sub { return 1; }, get_authorization_url => sub { return 'http://127.0.0.1' } );
+ $mock->fake_new( 'Net::Twitter' );
$mock->set_true(qw(
update
@@ -30,6 +30,11 @@ BEGIN {
sent_direct_messages
create_friend
destroy_friend
+
+ access_token
+ access_token_secret
+ get_authorization_url
+ request_access_token
));
$mock->set_list('friends', ());
@@ -44,7 +49,7 @@ SKIP: {
ok( my $obj = App::Maisha::Plugin::Identica->new(), "got object" );
isa_ok($obj,'App::Maisha::Plugin::Identica');
- my $ret = $obj->login({username => 'blah', password => 'blah'});
+ my $ret = $obj->login({ username => 'test', home => '.', test => 1 });
is($ret, 1, '.. login done');
my $api = $obj->api();

0 comments on commit e4ad14d

Please sign in to comment.