Changeset 4440 for trunk/Nebulous/t/18_client_open.t
- Timestamp:
- Jun 29, 2005, 4:35:06 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/18_client_open.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/18_client_open.t
r2896 r4440 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 18_client_open.t,v 1. 1 2005-01-05 01:41:05jhoblitt Exp $5 # $Id: 18_client_open.t,v 1.2 2005-06-30 02:35:06 jhoblitt Exp $ 6 6 7 7 use strict; … … 14 14 use lib qw( ./t ./lib ); 15 15 16 use PS::IPP::IData::Client;17 use PS::IPP::IData::Util qw( :standard );18 use Test:: IData;16 use Nebulous::Client; 17 use Nebulous::Util qw( :standard ); 18 use Test::Nebulous; 19 19 20 20 my $hostport = Apache::Test->config->{ 'hostport' }; 21 21 22 Test:: IData->setup;22 Test::Nebulous->setup; 23 23 24 24 { 25 25 # key 26 my $ idata = PS::IPP::IData::Client->new(27 proxy => "http://$hostport/ idata",26 my $neb = Nebulous::Client->new( 27 proxy => "http://$hostport/nebulous", 28 28 ); 29 $ idata->create( "foo" );30 my $fh = $ idata->open( "foo", 'read' );29 $neb->create( "foo" ); 30 my $fh = $neb->open( "foo", 'read' ); 31 31 32 32 is( ref $fh, 'GLOB', "good filehandle" ); 33 33 } 34 34 35 Test:: IData->setup;35 Test::Nebulous->setup; 36 36 37 37 { 38 38 # key 39 my $ idata = PS::IPP::IData::Client->new(40 proxy => "http://$hostport/ idata",39 my $neb = Nebulous::Client->new( 40 proxy => "http://$hostport/nebulous", 41 41 ); 42 $ idata->create( "foo" );43 my $fh = $ idata->open( "foo", 'write' );42 $neb->create( "foo" ); 43 my $fh = $neb->open( "foo", 'write' ); 44 44 45 45 is( ref $fh, 'GLOB', "good filehandle" ); 46 46 } 47 47 48 Test:: IData->setup;48 Test::Nebulous->setup; 49 49 50 50 { 51 my $ idata = PS::IPP::IData::Client->new(52 proxy => "http://$hostport/ idata",51 my $neb = Nebulous::Client->new( 52 proxy => "http://$hostport/nebulous", 53 53 ); 54 54 55 is( ref $ idata->open( "foo", 'write' ), 'GLOB', "create new object" );55 is( ref $neb->open( "foo", 'write' ), 'GLOB', "create new object" ); 56 56 } 57 57 58 Test:: IData->setup;58 Test::Nebulous->setup; 59 59 60 60 { 61 my $ idata = PS::IPP::IData::Client->new(62 proxy => "http://$hostport/ idata",61 my $neb = Nebulous::Client->new( 62 proxy => "http://$hostport/nebulous", 63 63 ); 64 64 65 is( $ idata->open( "foo", 'read' ), undef, "can't create new object" );65 is( $neb->open( "foo", 'read' ), undef, "can't create new object" ); 66 66 } 67 67 68 Test:: IData->setup;68 Test::Nebulous->setup; 69 69 70 70 eval { 71 my $ idata = PS::IPP::IData::Client->new(72 proxy => "http://$hostport/ idata",71 my $neb = Nebulous::Client->new( 72 proxy => "http://$hostport/nebulous", 73 73 ); 74 $ idata->open( "foo", 'bar' );74 $neb->open( "foo", 'bar' ); 75 75 }; 76 76 like( $@, qr/is read or write/, "2nd params not read or write" ); 77 77 78 Test:: IData->setup;78 Test::Nebulous->setup; 79 79 80 80 eval { 81 my $ idata = PS::IPP::IData::Client->new(82 proxy => "http://$hostport/ idata",81 my $neb = Nebulous::Client->new( 82 proxy => "http://$hostport/nebulous", 83 83 ); 84 $ idata->open();84 $neb->open(); 85 85 }; 86 86 like( $@, qr/2 were expected/, "no params" ); 87 87 88 Test:: IData->setup;88 Test::Nebulous->setup; 89 89 90 90 eval { 91 my $ idata = PS::IPP::IData::Client->new(92 proxy => "http://$hostport/ idata",91 my $neb = Nebulous::Client->new( 92 proxy => "http://$hostport/nebulous", 93 93 ); 94 $ idata->open( 1, 'read', 3 );94 $neb->open( 1, 'read', 3 ); 95 95 }; 96 96 like( $@, qr/2 were expected/, "too many params" ); 97 97 98 Test:: IData->cleanup;98 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
