Changeset 335
- Timestamp:
- 08/13/09 17:47:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/t/05_utils.t
r210 r335 1 1 use strict; 2 2 use warnings; 3 use Test::More tests => 2; 3 use Test::More tests => 5; 4 use File::Temp qw(mkstemp); 4 5 5 6 use_ok('LATMOS::Accounts::Utils'); … … 7 8 8 9 ok(la_log(LA_NOTICE, "a notice"), "can run la_log"); 10 11 my ($fh, $file) = mkstemp( "tmpfileXXXXX" ); 12 print $fh <<EOF; 13 attr1: attr1 14 attr: val1 15 attr: val2 16 EOF 17 18 seek($fh, 0, 0); 19 20 my %attributes = LATMOS::Accounts::Utils::parse_obj_file($fh); 21 $fh = undef; 22 23 # now testing 24 is($attributes{'attr1'}, 'attr1', "can get attribute from file"); 25 ok(eq_set($attributes{'attr'}, [ qw(val1 val2) ]), 26 "can get multiple values attribute"); 27 28 $ENV{EDITOR} = 'sleep 1; /bin/touch'; 29 30 ok(LATMOS::Accounts::Utils::dump_read_temp_file( 31 sub { 1; }, sub { 1; }), "Can edit temp file");
Note: See TracChangeset
for help on using the changeset viewer.