Changeset 5504
- Timestamp:
- Nov 10, 2005, 12:07:53 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (3 diffs)
-
Nebulous-Server/t/03_server_create_object.t (modified) (2 diffs)
-
Nebulous/lib/Nebulous/Server.pm (modified) (3 diffs)
-
Nebulous/t/03_server_create_object.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r5503 r5504 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1.1 6 2005-11-10 21:57:15jhoblitt Exp $3 # $Id: Server.pm,v 1.17 2005-11-10 22:07:53 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 90 90 { 91 91 type => SCALAR, 92 callbacks => { 93 # check that the comment isn't too long 94 'comment length' => sub { length $_[0] < 256 }, 95 }, 92 96 optional => 1, 93 97 }, … … 99 103 # add hooks to make this decision based on avaiable space 100 104 $volume = _get_storage_volume( $volume ); 101 102 # check that the comment isn't too long103 105 104 106 my $uri; -
trunk/Nebulous-Server/t/03_server_create_object.t
r5502 r5504 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 03_server_create_object.t,v 1. 9 2005-11-10 21:53:56jhoblitt Exp $5 # $Id: 03_server_create_object.t,v 1.10 2005-11-10 22:07:53 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 1 3;10 use Test::More tests => 14; 11 11 12 12 use lib qw( ./t ./lib ); … … 90 90 91 91 eval { 92 $neb->create_object( 1, 0, 'node01', 'x' x 256 ); 93 }; 94 like( $@, qr/comment length/, "comment is too long" ); 95 96 Test::Nebulous->setup; 97 98 eval { 92 99 $neb->create_object(); 93 100 }; -
trunk/Nebulous/lib/Nebulous/Server.pm
r5503 r5504 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1.1 6 2005-11-10 21:57:15jhoblitt Exp $3 # $Id: Server.pm,v 1.17 2005-11-10 22:07:53 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 90 90 { 91 91 type => SCALAR, 92 callbacks => { 93 # check that the comment isn't too long 94 'comment length' => sub { length $_[0] < 256 }, 95 }, 92 96 optional => 1, 93 97 }, … … 99 103 # add hooks to make this decision based on avaiable space 100 104 $volume = _get_storage_volume( $volume ); 101 102 # check that the comment isn't too long103 105 104 106 my $uri; -
trunk/Nebulous/t/03_server_create_object.t
r5502 r5504 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 03_server_create_object.t,v 1. 9 2005-11-10 21:53:56jhoblitt Exp $5 # $Id: 03_server_create_object.t,v 1.10 2005-11-10 22:07:53 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 1 3;10 use Test::More tests => 14; 11 11 12 12 use lib qw( ./t ./lib ); … … 90 90 91 91 eval { 92 $neb->create_object( 1, 0, 'node01', 'x' x 256 ); 93 }; 94 like( $@, qr/comment length/, "comment is too long" ); 95 96 Test::Nebulous->setup; 97 98 eval { 92 99 $neb->create_object(); 93 100 };
Note:
See TracChangeset
for help on using the changeset viewer.
