OSDN Git Service

added can_ok()
authormorimoto <morimoto@180c8125-5b33-4295-ad04-72a68a15b4cc>
Tue, 5 Aug 2008 14:08:25 +0000 (14:08 +0000)
committermorimoto <morimoto@180c8125-5b33-4295-ad04-72a68a15b4cc>
Tue, 5 Aug 2008 14:08:25 +0000 (14:08 +0000)
ChangeLog
t/02_ClientInfo.t
t/02_Config.t
t/02_IrcBuffer.t
t/02_IrcCallback.t
t/02_Log.t
t/02_Plugins.t
t/02_SessionManager.t
t/02_View.t

index 22c36b3..c98f0c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-05  Jun Morimoto  <morimoto@mrmt.net>
+
+       * t/*.t: added can_ok()
+
 2008-08-03  Jun Morimoto  <morimoto@mrmt.net>
 
        * lib/plugins/00all: added follow_nick option
index f033dd9..af697e5 100644 (file)
@@ -1,11 +1,10 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_ClientInfo.t,v 1.2 2008-08-03 04:38:26 morimoto Exp $
+# $Id: 02_ClientInfo.t,v 1.3 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_ClientInfo.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
 use strict;
 use warnings;
-# use Test::More tests => 52;
 use Test::More 'no_plan';
 use FindBin;
 use lib "$FindBin::Bin/../lib";
@@ -17,6 +16,12 @@ BEGIN {
        use_ok('Keitairc::ClientInfo');
 }
 
+can_ok('Keitairc::ClientInfo',
+       qw/new user_agent is_ezweb is_docomo is_ipod is_softbank
+       is_emobile is_emobile_mobilebrowser is_emobile_openbrowser
+       is_mobile softbank_serial docomo_foma_icc docomo_imodeid
+       au_subscriber_id emobile_userid serial_key cookie_available/);
+
 # au
 {
        my $header = new HTTP::Headers;
index 9842479..9ba1031 100644 (file)
@@ -1,5 +1,5 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_Config.t,v 1.5 2008-08-03 13:33:40 morimoto Exp $
+# $Id: 02_Config.t,v 1.6 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_Config.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
@@ -16,6 +16,8 @@ BEGIN {
 use Cwd;
 use Keitairc::Log;
 
+can_ok('Keitairc::Config', qw/new file/);
+
 my $version = '10.1';
 my $c = new Keitairc::Config({
        version => $version,
index 71b17d1..0625b83 100644 (file)
@@ -1,11 +1,11 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_IrcBuffer.t,v 1.1 2008-08-02 18:35:54 morimoto Exp $
+# $Id: 02_IrcBuffer.t,v 1.2 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_IrcBuffer.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
 use strict;
 use warnings;
-use Test::More tests => 1;
+use Test::More 'no_plan';
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 
@@ -13,4 +13,10 @@ BEGIN{
        use_ok('Keitairc::IrcBuffer');
 }
 
-# TODO: write some test
+can_ok('Keitairc::IrcBuffer',
+       qw/new add_nick list_nick remove_nick get_nick_realname op_nick
+       deop_nick get_nick_op channels now name2cid cid2name part join
+       mtime unread_lines topic buffer_ptr add_message
+       compact_channel_name simple_escape colorize update_timestamp/);
+
+# TODO: write reasonable test
index 57da276..a52deae 100644 (file)
@@ -1,15 +1,21 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_IrcCallback.t,v 1.1 2008-08-02 18:35:54 morimoto Exp $
+# $Id: 02_IrcCallback.t,v 1.2 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_IrcCallback.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
 use strict;
 use warnings;
-use Test::More tests => 1;
+use Test::More 'no_plan';
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 BEGIN {
        use_ok('Keitairc::IrcCallback');
 }
 
-# TODO: write some test
+can_ok('Keitairc::IrcCallback',
+       qw/irc_start irc_registered irc_001 irc_public irc_join
+       irc_part irc_quit irc_whoreply irc_mode irc_nick irc_notice
+       irc_topic irc_topicraw irc_msg irc_ctcp_action irc_reconnect
+       irc_connect irc_autoping/);
+
+# TODO: write reasonable test
index 964a062..6aada1d 100644 (file)
@@ -1,5 +1,5 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_Log.t,v 1.1 2008-08-02 18:35:54 morimoto Exp $
+# $Id: 02_Log.t,v 1.2 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_Log.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
@@ -12,3 +12,5 @@ use lib "$FindBin::Bin/../lib";
 BEGIN {
        use_ok('Keitairc::Log');
 }
+
+exit;
index 67ec237..4a887a9 100644 (file)
@@ -1,11 +1,11 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_Plugins.t,v 1.2 2008-08-03 04:38:26 morimoto Exp $
+# $Id: 02_Plugins.t,v 1.3 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_Plugins.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
 use strict;
 use warnings;
-use Test::More tests => 5;
+use Test::More tests => 6;
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 
@@ -13,6 +13,10 @@ BEGIN {
        use_ok('Keitairc::Plugins');
 }
 
+can_ok('Keitairc::Plugins',
+       qw/new list_plugins list_replace_plugins list_action_plugins
+       load_plugins/);
+
 use Keitairc::Config;
 use Keitairc::Log;
 
@@ -51,3 +55,5 @@ sub array_eq{
        }
        1;
 }
+
+
index ccffde3..5e6a446 100644 (file)
@@ -1,12 +1,12 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_SessionManager.t,v 1.1 2008-08-02 18:35:54 morimoto Exp $
+# $Id: 02_SessionManager.t,v 1.2 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_SessionManager.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
 use strict;
 use warnings;
 use Data::Dumper;
-use Test::More tests => 31;
+use Test::More tests => 32;
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 
@@ -14,6 +14,11 @@ BEGIN{
        use_ok('Keitairc::SessionManager');
 }
 
+# dh() is not class method
+can_ok('Keitairc::SessionManager',
+       qw/new verify search_by_session_id search_by_serial_key refresh
+       add garbage_collect delete normalize_user_agent/);
+
 # every serial strings are fictitious
 my $foma_ua = 'DoCoMo/2.0 P703imyu(c100;TB;W30H15)';
 my $foma_ua_icc = 'DoCoMo/2.0 P703imyu(c100;TB;W30H15;ser123498761234567;icc9876543210234567890F)';
index 0977988..26f9371 100644 (file)
@@ -1,15 +1,20 @@
 # -*- mode: perl; coding: utf-8 -*-
-# $Id: 02_View.t,v 1.1 2008-08-02 18:35:54 morimoto Exp $
+# $Id: 02_View.t,v 1.2 2008-08-05 14:08:25 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/t/02_View.t,v $
 # Copyright (c) 2003-2008 Jun Morimoto <morimoto@mrmt.net>
 # This program is covered by the GNU General Public License 2
 use strict;
 use warnings;
-use Test::More tests => 1;
+use Test::More tests => 2;
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 BEGIN {
        use_ok('Keitairc::View');
 }
 
-# TODO: write some test
+# timestamp() is not class method
+can_ok('Keitairc::View',
+       qw/new redirect template_path public_path template public
+       render/);
+
+# TODO: write reasonable test