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

« back to all changes in this revision

Viewing changes to t/60_db.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
 
 
7
BEGIN {
 
8
        unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) {
 
9
                plan skip_all => 'Needs DISPLAY';
 
10
                exit 0;
 
11
        }
 
12
        plan tests => 6;
 
13
}
 
14
 
 
15
use Test::NoWarnings;
 
16
use t::lib::Padre;
 
17
use Padre::DB ();
 
18
 
 
19
SCOPE: {
 
20
        my @files = Padre::DB::History->recent('files');
 
21
        is_deeply \@files, [], 'no files yet';
 
22
 
 
23
        Padre::DB::History->create(
 
24
                type => 'files',
 
25
                name => 'Test.pm',
 
26
        );
 
27
        Padre::DB::History->create(
 
28
                type => 'files',
 
29
                name => 'Test2.pm',
 
30
        );
 
31
        @files = Padre::DB::History->recent('files');
 
32
        is_deeply \@files, [ 'Test2.pm', 'Test.pm' ], 'files';
 
33
 
 
34
        # test delete_recent
 
35
        @files = Padre::DB::History->recent('files');
 
36
        is_deeply \@files, [ 'Test2.pm', 'Test.pm' ], 'files still remain after delete_recent pod';
 
37
        ok( Padre::DB::History->delete( 'where type = ?', 'files' ) );
 
38
        @files = Padre::DB::History->recent('files');
 
39
        is_deeply \@files, [], 'no files after delete_recent files';
 
40
}
 
41
 
 
42
1;