Skip to content
Snippets Groups Projects
Commit 00e44097 authored by Errietta Kostala's avatar Errietta Kostala
Browse files

A few tests.

parent 494ebfd7
Branches
Tags
No related merge requests found
#!/usr/bin/perl
use strict;
use warnings;
use Shell::Command;
use Test::Most;
chdir 't' or die $!;
if (!-d 'etc') {
plan skip_all => 'No need to tear previous env.';
}
ok rm_rf 'etc';
done_testing;
#!/usr/bin/perl
use strict;
use warnings;
use Test::Most;
system ("mkdir -p t/etc");
ok !$?;
system ("mkdir -p t/etc/.vcsh_home");
ok !$?;
chdir 't/etc/' or die $!;
system ("ln -s '../../vcsh'");
ok !$?;
done_testing;
#!/usr/bin/perl
use strict;
use warnings;
use Cwd 'abs_path';
use Test::Most;
chdir 't/etc/' or die $!;
$ENV{'HOME'} = abs_path ('.vcsh_home');
my $output = `./vcsh status`;
ok $output eq "", 'No repos set up yet.';
$output = `./vcsh init test1`;
ok $output eq "Initialized empty Git repository in " . $ENV{'HOME'} . "/.config/vcsh/repo.d/test1.git/\n";
$output = `./vcsh status`;
ok $output eq "test1:\n\n", 'Our new repo is there';
chdir $ENV{"HOME"} . '/.config/vcsh/repo.d/test1.git/' or die $!;
ok -f 'HEAD';
ok -d 'branches';
ok -f 'config';
ok -f 'description';
ok -d 'hooks';
ok -d 'info';
ok -d 'objects';
ok -d 'refs';
ok -f 'hooks/applypatch-msg.sample';
ok -f 'hooks/commit-msg.sample';
ok -f 'hooks/post-update.sample';
ok -f 'hooks/pre-applypatch.sample';
ok -f 'hooks/pre-commit.sample';
ok -f 'hooks/pre-push.sample';
ok -f 'hooks/pre-rebase.sample';
ok -f 'hooks/prepare-commit-msg.sample';
ok -f 'hooks/update.sample';
ok -f 'info/exclude';
ok -d 'objects/info';
ok -d 'objects/pack';
ok -d 'refs/heads';
ok -d 'refs/tags';
done_testing;
#!/usr/bin/perl
use strict;
use warnings;
use Cwd 'abs_path';
use Test::Most;
chdir 't/etc/' or die $!;
$ENV{'HOME'} = abs_path ('.vcsh_home');
system ("echo 'Yes, do as I say' | ./vcsh delete test1");
my $output = `./vcsh status`;
ok $output eq "", 'No repos set up anymore.';
done_testing;
#!/usr/bin/perl
use strict;
use warnings;
use Shell::Command;
use Test::Most;
chdir 't' or die $!;
if (!-d 'etc') {
plan skip_all => 'No need to tear previous env.';
}
ok rm_rf 'etc';
done_testing;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment