version 1.3, 2010/01/18 13:47:53 |
version 1.6, 2010/01/26 06:03:11 |
|
|
#=============================================================================== |
#=============================================================================== |
# |
# |
# FILE: filters.t |
# FILE: formats.t |
# |
# |
# DESCRIPTION: Test Text::Todo::REST::API |
# DESCRIPTION: Test Text::Todo::REST::API |
# |
# |
# AUTHOR: Andrew Fresh (AAF), andrew@cpan.org |
# AUTHOR: Andrew Fresh (AAF), andrew@cpan.org |
# COMPANY: Red River Communications |
# COMPANY: Red River Communications |
# CREATED: 01/07/10 19:11 |
# CREATED: 01/07/10 19:11 |
# REVISION: $AFresh1: formats.t,v 1.2 2010/01/17 21:53:35 andrew Exp $ |
# REVISION: $AFresh1: formats.t,v 1.5 2010/01/23 07:04:43 andrew Exp $ |
#=============================================================================== |
#=============================================================================== |
|
|
use strict; |
use strict; |
use warnings; |
use warnings; |
|
|
use Test::More tests => 6; |
use Test::More tests => 4; |
|
|
my $class; |
my $class; |
|
|
BEGIN { |
BEGIN { |
$class = 'Text::Todo::REST::API'; |
$class = 'Text::Todo::REST::API::Representations'; |
use_ok( $class, "use $class" ); |
use_ok( $class, "use $class" ); |
} |
} |
|
|
diag("Testing $class $Text::Todo::REST::API::VERSION"); |
diag("Testing $class $Text::Todo::REST::API::Representations::VERSION"); |
|
|
my $api = new_ok( $class, [ { todo_dir => 't/lists', path_info => '/todo' } ] ); |
my $path_info = '/'; |
|
|
my $result; |
my $api = new_ok( $class, [] ); |
ok( !eval { $result = $api->Load() }, 'Load method' ); |
|
like( $@, '/^Unable to Load \[list\]/', 'Failed Load as expected' ); |
|
$result = undef; |
|
|
|
ok( !eval { $result = $api->Dump() }, 'Dump method' ); |
ok( !defined $api->content_type, 'content_type method' ); |
like( $@, '/^Unable to Dump \[list\]/', 'Failed Dump as expected' ); |
ok( !defined $api->can_render, 'can_render method' ); |
$result = undef; |
|