12 my $path = "data.txt";
13 my $data = "random junk\n";
15 # create an object with an overloaded path
17 my $obj = FileObject->new( $path ) ;
19 isa_ok( $obj, 'FileObject' ) ;
20 is( "$obj", $path, "object stringifies to path" );
22 write_file( $obj, $data ) ;
24 my $read_text = read_file( $obj ) ;
25 is( $data, $read_text, 'read_file of stringified object' ) ;
31 # this code creates the object which has a stringified path
40 return bless { path => $_[1] }, $_[0]