~ubuntu-branches/ubuntu/precise/padre/precise

« back to all changes in this revision

Viewing changes to t/76-preferences.t

  • Committer: Package Import Robot
  • Author(s): Damyan Ivanov
  • Date: 2011-08-28 18:44:38 UTC
  • mfrom: (1.3.2 upstream) (13.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20110828184438-yytfgygb1otbnxoe
Tags: 0.90.ds1-1
* New upstream release
 + update dependencies:
   - add libcapture-tiny-perl 0.06 to Depends
   - add (build-) dependency on libmodule-corelist-perl 2.22 or a suitable
     perl
   - remove module-refresh and module-starter from (build-)dependencies
   - bump (build-)dependency on libppix-editortools-perl to 0.13
   - add (build-)dependency on libprobe-perl-perl
 + update debian/copyright to match the new release

* Move Vcs-Git from apps/ to packages/
* stop removing bundled fork of ORLite::Migrate (now heavily modified)
* update debian/not-real-manual.list
* revert the plugin API version bump
* add Breaks: for incompatible plugin versions
* upload to unstable
* add pod-spelling.patch from upstream
* update disable-tcp-server.patch to apply cleanly

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
use Test::More;
 
6
 
 
7
BEGIN {
 
8
        unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) {
 
9
                plan skip_all => 'Needs DISPLAY';
 
10
                exit 0;
 
11
        }
 
12
        plan tests => 10;
 
13
}
 
14
 
 
15
use Test::NoWarnings;
 
16
use t::lib::Padre;
 
17
use Padre::Wx;
 
18
use Padre;
 
19
use_ok('Padre::Wx::Dialog::Preferences');
 
20
 
 
21
# Create the IDE
 
22
my $padre = new_ok('Padre');
 
23
my $main  = $padre->wx->main;
 
24
isa_ok( $main, 'Padre::Wx::Main' );
 
25
 
 
26
# Create the Preferences 2.0 dialog
 
27
my $dialog = new_ok( 'Padre::Wx::Dialog::Preferences', [$main] );
 
28
 
 
29
# Check the listview properties
 
30
my $treebook = $dialog->treebook;
 
31
isa_ok( $treebook, 'Wx::Treebook' );
 
32
 
 
33
#my $listview = $treebook->GetListView;
 
34
#isa_ok( $listview, 'Wx::ListView' );
 
35
#is( $listview->,       8,   'Found siz items' );
 
36
#is( $listview->GetColumnCount,     0,   'Found one column' );
 
37
#is( $listview->GetColumnWidth(-1), 100, 'Got column width' );
 
38
 
 
39
# Load the dialog from configuration
 
40
my $config = $main->config;
 
41
isa_ok( $config, 'Padre::Config' );
 
42
ok( $dialog->config_load($config), '->load ok' );
 
43
 
 
44
# The diff (extracted from dialog) to the config should be null,
 
45
# except maybe for a potential default font value. This is because
 
46
# SetSelectedFont() doesn't work on wxNullFont.
 
47
my $diff = $dialog->config_diff($config);
 
48
if ($diff) {
 
49
        is scalar keys %$diff, 1, 'only one key defined in the diff';
 
50
        ok exists $diff->{editor_font}, 'only key defined is "editor_font"';
 
51
} else {
 
52
        ok !$diff, 'null font loaded, config_diff() returned nothing';
 
53
        ok 1, 'placebo to stick to the plan';
 
54
}
 
55