Show
Ignore:
Timestamp:
04/22/08 15:47:11 (6 years ago)
Author:
nekokak
Message:

自前でtieするのやめてTest::Output使うようにした

Location:
lang/perl/Test-Declare/trunk
Files:
2 removed
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Test-Declare/trunk/lib/Test/Declare.pm

    r9550 r10132  
    2727use Test::Exception; 
    2828use Test::Warn; 
     29use Test::Output; 
    2930use Test::Deep; 
    3031 
     
    3536    prints_ok stderr_ok 
    3637    warning_like warnings_like warning_is warnings_are 
     38    stdout_is stdout_isnt stdout_like stdout_unlike 
     39    stderr_is stderr_isnt stderr_like stderr_unlike 
     40    combined_is combined_isnt combined_like combined_unlike 
     41    output_is output_isnt output_like output_unlike 
    3742); 
    3843 
     
    106111    my $test_more_code = "Test\::More"->can('ok'); 
    107112    goto $test_more_code, $test, $name||$test_block_name; 
    108 } 
    109  
    110 ## original method 
    111 use IO::Scalar; 
    112 sub prints_ok (&$;$) { ## no critic 
    113     my ($code, $expected, $name) = @_; 
    114  
    115     tie *STDOUT, 'IO::Scalar', \my $stdout; 
    116         $code->(); 
    117         like($stdout, qr/$expected/, $name||$test_block_name); 
    118     untie *STDOUT; 
    119 } 
    120 sub stderr_ok (&$;$) { ## no critic 
    121     my ($code, $expected, $name) = @_; 
    122  
    123     tie *STDERR, 'IO::Scalar', \my $stderr; 
    124         $code->(); 
    125         like($stderr, qr/$expected/, $name||$test_block_name); 
    126     untie *STDERR; 
    127113} 
    128114