Ignore:
Timestamp:
11/30/09 22:16:31 (2 years ago)
Author:
adamk
Message:

Completed the WXG file object, but not entirely sure if I'm going to need it yet. Better to just implement it while everything is fresh in my head.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-wxGlade/t/03_wxg.t

    r9354 r9355  
    66use strict; 
    77use warnings; 
    8 use Test::More 0.82 tests => 2; 
     8use Test::More 0.82 tests => 19; 
    99use File::Spec::Functions ':ALL'; 
    1010use Padre::Plugin::wxGlade::WXG (); 
     
    1212my $SAMPLE = catfile( 't', 'sample', 'Dialogs.wxg' ); 
    1313ok( -f $SAMPLE, 'Sample wxg file exists' ); 
     14 
     15my @WINDOWS = qw{ 
     16    frame_1 
     17    dialog_find 
     18    dialog_replace 
     19    dialog_openurl 
     20    dialog_warning 
     21};   
    1422 
    1523 
     
    2533); 
    2634 
     35# Accessor tests 
     36is( $wxg->wxg,         $SAMPLE, '->file ok'        ); 
     37is( $wxg->language,    'perl',  '->language ok'    ); 
     38is( $wxg->for_version, '2.8',   '->for_version ok' ); 
     39is( $wxg->path, 'F:\padre\wxglade\Dialogs.pl', '->path ok' ); 
     40 
     41# Get the list of windows 
     42my @windows = $wxg->windows; 
     43is_deeply( 
     44    \@windows, 
     45    \@WINDOWS, 
     46    'Found expected windows', 
     47); 
     48 
     49# Load a named window 
     50is( ref($wxg->window('dialog_warning')), 'HASH', 'Found dialog_warning' ); 
     51is( ref($wxg->top_window), 'HASH', 'Found ->top_window' ); 
     52 
     53# Extract the Perl class for each 
     54foreach my $name ( @WINDOWS ) { 
     55    my $code = $wxg->extract( $wxg->window($name) ); 
     56    ok( defined $code, 'Found code for $name' ); 
     57    ok( length($code), 'Found code for $name' ); 
     58} 
     59 
    27601; 
Note: See TracChangeset for help on using the changeset viewer.