Skip to content

Commit

Permalink
Merge pull request #55 from joshrabinowitz/moretests
Browse files Browse the repository at this point in the history
simple test using simple_crud()
  • Loading branch information
bigpresh committed Jul 26, 2016
2 parents 88c46e2 + 23317ca commit 406dd04
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Expand Up @@ -17,6 +17,7 @@ WriteMakefile(
'Dancer::Plugin::Database' => 1.00,
'HTML::Table::FromDatabase' => 1.10,
'CGI::FormBuilder' => 0,
'DBD::CSV' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Dancer-Plugin-SimpleCRUD-*' },
Expand Down
21 changes: 21 additions & 0 deletions t/01-routes.t
@@ -0,0 +1,21 @@
#!perl

use Test::More;

use Dancer qw(:syntax :tests);
use Dancer::Test;
use File::Temp;

use FindBin qw($Bin);
use lib "$Bin/lib"; #
my $filename = File::Temp->new(UNLINK=>1); # will be automatically unlinked. Set to 0 to keep.

config->{plugins}{Database}{driver} = "CSV";
config->{plugins}{Database}{database} = $filename;
use_ok( 'TestCRUD' ) || die "Can't load test module TestCRUD";

route_exists [ GET => '/test_table' ];

done_testing();


12 changes: 12 additions & 0 deletions t/lib/TestCRUD.pm
@@ -0,0 +1,12 @@
package TestCRUD;
use Dancer ':syntax';

our $VERSION = '0.01';

use Dancer::Plugin::SimpleCRUD;

simple_crud(
prefix => "/test_table",
db_table => "test_table",
);

0 comments on commit 406dd04

Please sign in to comment.