Changeset 15020 for trunk/DataStore/t/05_product.t
- Timestamp:
- Sep 25, 2007, 1:37:44 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/DataStore/t/05_product.t (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStore/t/05_product.t
r8722 r15020 3 3 # Copyright (C) 2006 Joshua Hoblitt 4 4 # 5 # $Id: 05_product.t,v 1. 5 2006-08-31 22:58:34 jhoblitt Exp $5 # $Id: 05_product.t,v 1.6 2007-09-25 23:37:44 jhoblitt Exp $ 6 6 7 7 use strict; … … 10 10 use lib qw( ./lib ./t ); 11 11 12 use Test::More tests => 2 2;12 use Test::More tests => 23; 13 13 14 14 =head1 NAME … … 32 32 33 33 { 34 my $dsp = DataStore::Product->new( uri => 'http://example.org/ ' );34 my $dsp = DataStore::Product->new( uri => 'http://example.org/index.txt' ); 35 35 36 36 isa_ok($dsp, 'DataStore::Product'); … … 39 39 { 40 40 my $dsp = DataStore::Product->new( 41 uri => 'http://example.org/ ',41 uri => 'http://example.org/index.txt', 42 42 last_fileset => '12buckelyourshoe', 43 43 ); … … 47 47 48 48 eval { 49 my $dsp = DataStore::Product->new( uri => 'http://example.org/ ', foo => 1 );49 my $dsp = DataStore::Product->new( uri => 'http://example.org/index.txt', foo => 1 ); 50 50 }; 51 51 like($@, qr/not listed in the validation options/, … … 54 54 eval { 55 55 my $dsp = DataStore::Product->new( 56 uri => 'http://example.org/ ',56 uri => 'http://example.org/index.txt', 57 57 last_fileset => '12buckelyourshoe', 58 58 foo => 1, … … 65 65 my $dsp = DataStore::Product->new( uri => 'http://example.org' ); 66 66 }; 67 like($@, qr/ is valid uri dirname/,68 '->new() fails when uri param does not end with / ');67 like($@, qr/uri ends with \/index.txt/, 68 '->new() fails when uri param does not end with /index.txt'); 69 69 70 70 eval { 71 my $dsp = DataStore::Product->new( uri => '://example.org' ); 71 my $dsp = DataStore::Product->new( uri => 'http://example.org/index.html' ); 72 }; 73 like($@, qr/uri ends with \/index.txt/, 74 '->new() fails when uri param does not end with /index.txt'); 75 76 eval { 77 my $dsp = DataStore::Product->new( uri => '://example.org/index.txt' ); 72 78 }; 73 79 like($@, qr/is valid http uri/, … … 76 82 eval { 77 83 my $dsp = DataStore::Product->new( 78 uri => 'http://example.org/ ',84 uri => 'http://example.org/index.txt', 79 85 last_fileset => '++12buckelyourshoe', 80 86 ); … … 130 136 print $server->Start(), "\n"; 131 137 132 $server->RegisterURL('/ ', \&bar);138 $server->RegisterURL('/index.txt', \&bar); 133 139 $server->Process(); # Run forever 134 140 … … 140 146 141 147 { 142 my $dsp = DataStore::Product->new( uri => "http://localhost:$port/ " );148 my $dsp = DataStore::Product->new( uri => "http://localhost:$port/index.txt" ); 143 149 144 150 isa_ok($dsp->request, 'DataStore::Response'); … … 146 152 147 153 { 148 my $dsp = DataStore::Product->new( uri => "http://localhost:$port/ " );154 my $dsp = DataStore::Product->new( uri => "http://localhost:$port/index.txt" ); 149 155 150 156 my $dsr = $dsp->request; … … 168 174 169 175 eval { 170 my $dsp = DataStore::Product->new( uri => 'http://example.org/ ' );176 my $dsp = DataStore::Product->new( uri => 'http://example.org/index.txt' ); 171 177 172 178 $dsp->request( foo => 1 );
Note:
See TracChangeset
for help on using the changeset viewer.
