[Bps-public-commit] r17427 - in Net-Google-Code/trunk: .
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Dec 30 04:52:27 EST 2008
Author: sunnavy
Date: Tue Dec 30 04:52:26 2008
New Revision: 17427
Added:
Net-Google-Code/trunk/t/01.connection.t
Modified:
Net-Google-Code/trunk/ (props changed)
Log:
r18350 at sunnavys-mb: sunnavy | 2008-12-30 15:10:14 +0800
added t/01.connection.t
Added: Net-Google-Code/trunk/t/01.connection.t
==============================================================================
--- (empty file)
+++ Net-Google-Code/trunk/t/01.connection.t Tue Dec 30 04:52:26 2008
@@ -0,0 +1,20 @@
+use strict;
+use warnings;
+
+use Test::More tests => 4;
+use_ok('Net::Google::Code::Connection');
+my $connection = Net::Google::Code::Connection->new( project => 'test' );
+is( $connection->base_url, 'http://code.google.com/p/', 'default base_url' );
+isa_ok( $connection->mech, 'Net::Google::Code::Mechanize' );
+
+use Test::MockModule;
+
+my $mech = Test::MockModule->new('Net::Google::Code::Mechanize');
+my $resp = Test::MockModule->new('HTTP::Response');
+
+$mech->mock( 'content', sub { 'content' } );
+$mech->mock( 'get', sub {} );
+$mech->mock( 'response', sub { HTTP::Response->new } );
+$resp->mock( 'is_success', sub { 1 } );
+
+is( $connection->_fetch('blabla'), 'content', '_fetch' );
More information about the Bps-public-commit
mailing list