3
# Test the style subsystem
11
unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) {
12
plan skip_all => 'Needs DISPLAY';
18
use File::Spec::Functions ':ALL';
24
my $dir = catdir( 'share', 'styles' );
25
ok( -d $dir, "Found style directory $dir" );
39
######################################################################
40
# Check the new Padre::Style API
42
use_ok('Padre::Config::Style');
43
my $hash = Padre::Config::Style->core_styles;
44
is( scalar( keys %$hash ), 6, 'Found 6 core styles' );
45
my @user = Padre::Config::Style->user_styles;
51
######################################################################
52
# Make sure the bundled styles all load
54
foreach my $name (@styles) {
55
my $file = catfile( $dir, "$name.yml" );
56
ok( -f $file, "Found style file $file" );
57
my $style = Padre::Config::Style->load( $name => $file );
58
isa_ok( $style, 'Padre::Config::Style' );
59
is( $style->name, $name, '->name ok' );
60
is( ref( $style->data ), 'HASH', '->data is a HASH' );
61
foreach (qw{ plain padre perl }) {
62
is( ref( $style->data->{$_} ), 'HASH', "->data->{$_} is defined" );
70
######################################################################
71
# Ensure the new style API loads as well
73
use_ok('Padre::Wx::Style');