Changeset 92 in bookmarks for trunk/lib/Bookmarks.pm


Ignore:
Timestamp:
06/05/15 22:48:45 (9 years ago)
Author:
peter
Message:

issue #10: added basic test of the web app and the Bookmark class

To make the application testable, BookmarksApp now does not require a
config_file to be set, and can just be configured via a config hash in the
constructor. In addition, authentication and reverse proxy rewriting are now
conditionally enabled based on whether there is an auth and proxy_ip key in
the config, respecitvely.

Added Plack 1.0036 to the cpanfile dependencies, since that is the version that
contains Plack::Test.

Also fixed the Bookmarks::create_tables() method to load the
bookmarks.sql file from the correct location.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Bookmarks.pm

    r88 r92  
    3939    my $self = shift; 
    4040    require File::Slurp; 
    41     require FindBin; 
    42     my $table_definitions = File::Slurp::read_file("$FindBin::RealBin/bookmarks.sql"); 
     41    require File::Basename; 
     42    my $table_definitions = File::Slurp::read_file(File::Basename::dirname($INC{'Bookmarks.pm'}) . "/../bookmarks.sql"); 
    4343    $self->dbh->{sqlite_allow_multiple_statements} = 1; 
    4444    $self->dbh->do($table_definitions); 
Note: See TracChangeset for help on using the changeset viewer.