pull from upstream repository
[git-darcs-import.git] / tests / init.pl
blob9dc1187c04b08a9441195768d1a1ba69c558978a
1 #!/usr/bin/env perl
3 # Some tests for the repodir flag
5 use lib 'lib/perl';
6 use Test::More 'no_plan';
7 use Test::Darcs;
8 use Shell::Command;
9 use strict;
10 use warnings;
12 my $test_name = 'Make sure that a simple init works.';
13 init_tmp_repo();
15 ok((-d '_darcs'), '_darcs directory was created');
17 $test_name = 'Make sure that init in a pre-existing darcs directory fails.';
18 like(darcs('init'), qr/not run this command in a repository/, $test_name);
20 $test_name = 'Make sure that init --repodir creates the directory if it does not exist';
22 cleanup 'temp1';
23 darcs 'init --repodir=temp1';
24 ok((-d 'temp1/_darcs'), '_darcs directory was created');