~ubuntu-branches/ubuntu/saucy/padre/saucy-proposed

« back to all changes in this revision

Viewing changes to t/50_browser.t

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

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
use Padre::Constant;
 
7
 
 
8
BEGIN {
 
9
 
 
10
        require Win32 if Padre::Constant::WIN32;
 
11
        unless ( $ENV{DISPLAY} or Padre::Constant::WIN32 ) {
 
12
                plan skip_all => 'Needs DISPLAY';
 
13
                exit 0;
 
14
        }
 
15
        if ( Padre::Constant::WIN32 ? Win32::IsAdminUser() : !$< ) {
 
16
                plan skip_all => 'Cannot run as root';
 
17
                exit 0;
 
18
        }
 
19
}
 
20
 
 
21
plan tests => 14;
 
22
 
 
23
use Test::NoWarnings;
 
24
use File::Spec::Functions qw( catfile );
 
25
use File::Temp ();
 
26
use URI;
 
27
 
 
28
BEGIN {
 
29
        $ENV{PADRE_HOME} = File::Temp::tempdir( CLEANUP => 1 );
 
30
}
 
31
 
 
32
use_ok('Padre::Browser');
 
33
use_ok('Padre::Task::Browser');
 
34
use_ok('Padre::Browser::Document');
 
35
 
 
36
my $db = Padre::Browser->new();
 
37
 
 
38
ok( $db, 'instance Padre::Browser' );
 
39
 
 
40
my $doc = Padre::Browser::Document->load( catfile( 'lib', 'Padre', 'Browser.pm' ) );
 
41
isa_ok( $doc, 'Padre::Browser::Document' );
 
42
ok( $doc->mimetype eq 'application/x-perl', 'Mimetype is sane' );
 
43
my $docs = $db->docs($doc);
 
44
isa_ok( $docs, 'Padre::Browser::Document' );
 
45
 
 
46
my $tm = $db->resolve( URI->new('perldoc:Test::More') );
 
47
isa_ok( $tm, 'Padre::Browser::Document' );
 
48
ok( $tm->mimetype eq 'application/x-pod', 'Resolve from uri' );
 
49
cmp_ok( $tm->title, 'eq', 'Test::More', 'Doc title discovered' );
 
50
 
 
51
my $view = $db->browse($tm);
 
52
isa_ok( $view, 'Padre::Browser::Document' );
 
53
ok( $view->mimetype eq 'text/xhtml', 'Got html view' );
 
54
cmp_ok( $view->title, 'eq', 'Test::More', 'Title' );
 
55
 
 
56