1# Testing documents that should fail 2use strict; 3use warnings; 4use lib 't/lib/'; 5use Test::More 0.88; 6use TestUtils; 7 8use File::Spec::Functions ':ALL'; 9 10 11 12##################################################################### 13# Customized Class 14 15SCOPE: { 16 package Foo; 17 18 use CPAN::Meta::YAML; 19 20 use vars qw{@ISA}; 21 BEGIN { 22 @ISA = 'CPAN::Meta::YAML'; 23 } 24 25 # XXX-INGY subclasses should not use private methods… or if they 26 # do they should expect method name changes. 27 # sub _write_scalar { 28 29 sub _dump_scalar { 30 my $self = shift; 31 my $string = shift; 32 my $is_key = shift; 33 if ( defined $is_key ) { 34 return scalar reverse $string; 35 } else { 36 return $string; 37 } 38 } 39 40 1; 41} 42 43 44 45 46 47##################################################################### 48# Generate the value 49 50my $object = Foo->new( 51 { foo => 'bar' } 52); 53is( $object->write_string, "---\noof: bar\n", 'Subclassing works' ); 54 55done_testing; 56