| ... | ... |
@@ -8,6 +8,9 @@ use Encode qw/encode decode/; |
| 8 | 8 |
|
| 9 | 9 |
use Test::Mojo; |
| 10 | 10 |
|
| 11 |
+# Data directory |
|
| 12 |
+my $data_dir = "$FindBin::Bin/basic"; |
|
| 13 |
+ |
|
| 11 | 14 |
# Test DB |
| 12 | 15 |
$ENV{GITPREP_DB_FILE} = "$FindBin::Bin/basic/gitprep.db";
|
| 13 | 16 |
|
| ... | ... |
@@ -22,6 +25,9 @@ $ENV{GITPREP_NO_MYCONFIG} = 1;
|
| 22 | 25 |
use Gitprep; |
| 23 | 26 |
|
| 24 | 27 |
my $app = Gitprep->new; |
| 28 |
+$app->config(data_dir => $data_dir); |
|
| 29 |
+$app->manager->setup_database; |
|
| 30 |
+ |
|
| 25 | 31 |
my $t = Test::Mojo->new($app); |
| 26 | 32 |
|
| 27 | 33 |
my $user = 'kimoto'; |
| ... | ... |
@@ -11,6 +11,9 @@ use Encode qw/encode decode/; |
| 11 | 11 |
|
| 12 | 12 |
use Test::Mojo; |
| 13 | 13 |
|
| 14 |
+# Data directory |
|
| 15 |
+my $data_dir = "$FindBin::Bin/import_rep"; |
|
| 16 |
+ |
|
| 14 | 17 |
# Test DB |
| 15 | 18 |
my $db_file = $ENV{GITPREP_DB_FILE} = "$FindBin::Bin/import_rep/gitprep.db";
|
| 16 | 19 |
|
| ... | ... |
@@ -27,7 +30,9 @@ note 'import_rep'; |
| 27 | 30 |
rmtree $rep_home; |
| 28 | 31 |
|
| 29 | 32 |
my $app = Gitprep->new; |
| 33 |
+ $app->config(data_dir => $data_dir); |
|
| 30 | 34 |
$app->manager->setup_database; |
| 35 |
+ |
|
| 31 | 36 |
my $t = Test::Mojo->new($app); |
| 32 | 37 |
$t->ua->max_redirects(3); |
| 33 | 38 |
|
| ... | ... |
@@ -12,6 +12,9 @@ use MIME::Base64 'encode_base64'; |
| 12 | 12 |
|
| 13 | 13 |
use Test::Mojo; |
| 14 | 14 |
|
| 15 |
+# Data directory |
|
| 16 |
+my $data_dir = "$FindBin::Bin/smart_http"; |
|
| 17 |
+ |
|
| 15 | 18 |
# Test DB |
| 16 | 19 |
my $db_file = $ENV{GITPREP_DB_FILE} = "$FindBin::Bin/smart_http/gitprep.db";
|
| 17 | 20 |
|
| ... | ... |
@@ -28,7 +31,9 @@ note 'Smart HTTP'; |
| 28 | 31 |
rmtree $rep_home; |
| 29 | 32 |
|
| 30 | 33 |
my $app = Gitprep->new; |
| 34 |
+ $app->config(data_dir => $data_dir); |
|
| 31 | 35 |
$app->manager->setup_database; |
| 36 |
+ |
|
| 32 | 37 |
my $t = Test::Mojo->new($app); |
| 33 | 38 |
$t->ua->max_redirects(3); |
| 34 | 39 |
|
| ... | ... |
@@ -137,7 +142,9 @@ note 'Private repository and collaborator'; |
| 137 | 142 |
rmtree $rep_home; |
| 138 | 143 |
|
| 139 | 144 |
my $app = Gitprep->new; |
| 145 |
+ $app->config(data_dir => $data_dir); |
|
| 140 | 146 |
$app->manager->setup_database; |
| 147 |
+ |
|
| 141 | 148 |
my $t = Test::Mojo->new($app); |
| 142 | 149 |
$t->ua->max_redirects(3); |
| 143 | 150 |
|
| ... | ... |
@@ -11,6 +11,9 @@ use Encode qw/encode decode/; |
| 11 | 11 |
|
| 12 | 12 |
use Test::Mojo; |
| 13 | 13 |
|
| 14 |
+# Data directory |
|
| 15 |
+my $data_dir = "$FindBin::Bin/user"; |
|
| 16 |
+ |
|
| 14 | 17 |
# Test DB |
| 15 | 18 |
my $db_file = $ENV{GITPREP_DB_FILE} = "$FindBin::Bin/user/gitprep.db";
|
| 16 | 19 |
|
| ... | ... |
@@ -26,7 +29,9 @@ note 'Start page'; |
| 26 | 29 |
unlink $db_file; |
| 27 | 30 |
|
| 28 | 31 |
my $app = Gitprep->new; |
| 32 |
+ $app->config(data_dir => $data_dir); |
|
| 29 | 33 |
$app->manager->setup_database; |
| 34 |
+ |
|
| 30 | 35 |
my $t = Test::Mojo->new($app); |
| 31 | 36 |
$t->ua->max_redirects(3); |
| 32 | 37 |
|
| ... | ... |
@@ -64,7 +69,9 @@ note 'Admin page'; |
| 64 | 69 |
unlink $db_file; |
| 65 | 70 |
|
| 66 | 71 |
my $app = Gitprep->new; |
| 72 |
+ $app->config(data_dir => $data_dir); |
|
| 67 | 73 |
$app->manager->setup_database; |
| 74 |
+ |
|
| 68 | 75 |
my $t = Test::Mojo->new($app); |
| 69 | 76 |
$t->ua->max_redirects(3); |
| 70 | 77 |
|
| ... | ... |
@@ -204,7 +211,9 @@ note 'Reset password'; |
| 204 | 211 |
unlink $db_file; |
| 205 | 212 |
|
| 206 | 213 |
my $app = Gitprep->new; |
| 214 |
+ $app->config(data_dir => $data_dir); |
|
| 207 | 215 |
$app->manager->setup_database; |
| 216 |
+ |
|
| 208 | 217 |
my $t = Test::Mojo->new($app); |
| 209 | 218 |
$t->ua->max_redirects(3); |
| 210 | 219 |
|
| ... | ... |
@@ -264,7 +273,9 @@ note 'Profile'; |
| 264 | 273 |
rmtree $rep_home; |
| 265 | 274 |
|
| 266 | 275 |
my $app = Gitprep->new; |
| 276 |
+ $app->config(data_dir => $data_dir); |
|
| 267 | 277 |
$app->manager->setup_database; |
| 278 |
+ |
|
| 268 | 279 |
my $t = Test::Mojo->new($app); |
| 269 | 280 |
$t->ua->max_redirects(3); |
| 270 | 281 |
|
| ... | ... |
@@ -405,7 +416,9 @@ note 'Profile'; |
| 405 | 416 |
note 'fork'; |
| 406 | 417 |
{
|
| 407 | 418 |
my $app = Gitprep->new; |
| 419 |
+ $app->config(data_dir => $data_dir); |
|
| 408 | 420 |
$app->manager->setup_database; |
| 421 |
+ |
|
| 409 | 422 |
my $t = Test::Mojo->new($app); |
| 410 | 423 |
$t->ua->max_redirects(3); |
| 411 | 424 |
|
| ... | ... |
@@ -431,7 +444,9 @@ note 'fork'; |
| 431 | 444 |
note 'Network'; |
| 432 | 445 |
{
|
| 433 | 446 |
my $app = Gitprep->new; |
| 447 |
+ $app->config(data_dir => $data_dir); |
|
| 434 | 448 |
$app->manager->setup_database; |
| 449 |
+ |
|
| 435 | 450 |
my $t = Test::Mojo->new($app); |
| 436 | 451 |
$t->ua->max_redirects(3); |
| 437 | 452 |
|
| ... | ... |
@@ -451,7 +466,9 @@ note 'Network'; |
| 451 | 466 |
note 'Delete branch'; |
| 452 | 467 |
{
|
| 453 | 468 |
my $app = Gitprep->new; |
| 469 |
+ $app->config(data_dir => $data_dir); |
|
| 454 | 470 |
$app->manager->setup_database; |
| 471 |
+ |
|
| 455 | 472 |
my $t = Test::Mojo->new($app); |
| 456 | 473 |
$t->ua->max_redirects(3); |
| 457 | 474 |
|
| ... | ... |
@@ -483,7 +500,9 @@ note 'Delete branch'; |
| 483 | 500 |
note 'import-branch'; |
| 484 | 501 |
{
|
| 485 | 502 |
my $app = Gitprep->new; |
| 503 |
+ $app->config(data_dir => $data_dir); |
|
| 486 | 504 |
$app->manager->setup_database; |
| 505 |
+ |
|
| 487 | 506 |
my $t = Test::Mojo->new($app); |
| 488 | 507 |
$t->ua->max_redirects(3); |
| 489 | 508 |
|
| ... | ... |
@@ -553,7 +572,9 @@ note 'Private repository and collaborator'; |
| 553 | 572 |
rmtree $rep_home; |
| 554 | 573 |
|
| 555 | 574 |
my $app = Gitprep->new; |
| 575 |
+ $app->config(data_dir => $data_dir); |
|
| 556 | 576 |
$app->manager->setup_database; |
| 577 |
+ |
|
| 557 | 578 |
my $t = Test::Mojo->new($app); |
| 558 | 579 |
$t->ua->max_redirects(3); |
| 559 | 580 |
|