Changeset 852


Ignore:
Timestamp:
11/09/08 05:42:32 (3 years ago)
Author:
szabgab
Message:

some more unit tests for Padre::Document

Location:
trunk/t
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/70-document.t

    r850 r852  
    55use Test::NeedsDisplay; 
    66use Test::More; 
     7use File::Spec  (); 
    78use t::lib::Padre; 
    89use t::lib::Padre::Editor; 
     
    1314use Padre::Document; 
    1415 
    15 my $editor = t::lib::Padre::Editor->new; 
    16 my $d = Padre::Document->new(editor => $editor); 
     16my $editor_1 = t::lib::Padre::Editor->new; 
     17my $doc_1 = Padre::Document->new(editor => $editor_1); 
     18 
     19SCOPE: { 
     20    isa_ok($doc_1, 'Padre::Document'); 
     21    ok(not(defined $doc_1->filename), 'no filename'); 
     22    BEGIN { $tests += 2; } 
     23} 
     24 
     25#my $editor_2 = t::lib::Padre::Editor->new; 
     26#my $file_2   = File::Spec->catfile('eg', 'no_such_file.txt'); 
     27#my $doc_2 = Padre::Document->new( 
     28#       editor   => $editor_2, 
     29#       filename => $file_2, 
     30#   ); 
     31#SCOPE: { 
     32#   isa_ok($doc_2, 'Padre::Document'); 
     33#    BEGIN { $tests += 1; } 
     34#} 
     35# 
    1736 
    1837 
     38my $editor_3 = t::lib::Padre::Editor->new; 
     39my $file_3   = File::Spec->catfile('eg', 'hello_world.pl'); 
     40my $doc_3 = Padre::Document->new( 
     41        editor   => $editor_3, 
     42        filename => $file_3, 
     43    ); 
    1944SCOPE: { 
    20     isa_ok($d, 'Padre::Document'); 
    21     BEGIN { $tests += 1; } 
     45    isa_ok($doc_3, 'Padre::Document'); 
     46    is($doc_3->filename, $file_3, 'filename'); 
     47    BEGIN { $tests += 2; } 
    2248} 
    2349 
     50 
  • trunk/t/lib/Padre/Editor.pm

    r850 r852  
    1717} 
    1818 
    19 #sub ConvertEOLs { 
    20 #} 
     19sub ConvertEOLs { 
     20} 
     21 
     22sub  GetText { 
     23} 
     24 
    2125 
    22261; 
Note: See TracChangeset for help on using the changeset viewer.