summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-02 00:03:29 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-02 00:03:29 -0700
commitd6eca5d1d0b2e6bf539f25ea10948c8c396cbe8e (patch)
tree857a3de435f2a4d58a8612992b0bc97509b659a8 /t
parent6e1ae015b4d6a55512be3f16f9a3eaaef343f09f (diff)
downloadp5-Git-Annex-d6eca5d1d0b2e6bf539f25ea10948c8c396cbe8e.tar.gz
tests: use 'is'
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 't')
-rwxr-xr-xt/10_init.t12
-rwxr-xr-xt/11_utils.t6
-rwxr-xr-xt/12_unused.t6
3 files changed, 12 insertions, 12 deletions
diff --git a/t/10_init.t b/t/10_init.t
index b04321e..f49fd20 100755
--- a/t/10_init.t
+++ b/t/10_init.t
@@ -15,29 +15,29 @@ use File::Spec::Functions qw(catfile);
{
my $temp = tempdir CLEANUP => 1;
my $annex = Git::Annex->new($temp);
- ok $annex->toplevel eq $temp, "constructor sets toplevel to provided dir";
+ is $annex->toplevel, $temp, "constructor sets toplevel to provided dir";
local $CWD = $temp;
$annex = Git::Annex->new;
- ok $annex->toplevel eq $temp, "constructor sets toplevel to pwd";
+ is $annex->toplevel, $temp, "constructor sets toplevel to pwd";
}
{
my $temp = tempdir CLEANUP => 1;
my $annex = Git::Annex->new($temp);
- ok !defined $annex->{git}, "Git::Wrapper instance lazily instantiated";
+ is $annex->{git}, undef, "Git::Wrapper instance lazily instantiated";
ok $annex->git->isa("Git::Wrapper") && defined $annex->{git},
"Git::Wrapper instance available";
- ok $annex->git->dir eq $temp, "Git::Wrapper has correct toplevel";
+ is $annex->git->dir, $temp, "Git::Wrapper has correct toplevel";
}
# lazy init of Git::Repository object requires an actual git repo, not
# just an empty tempdir
with_temp_annexes {
my $annex = Git::Annex->new("source1");
- ok !defined $annex->{repo}, "Git::Repository instance lazily instantiated";
+ is $annex->{repo}, undef, "Git::Repository instance lazily instantiated";
ok $annex->repo->isa("Git::Repository") && defined $annex->{repo},
"Git::Repository instance available";
- ok $annex->repo->work_tree eq catfile(shift, "source1"),
+ is $annex->repo->work_tree, catfile(shift, "source1"),
"Git::Repository has correct toplevel";
};
diff --git a/t/11_utils.t b/t/11_utils.t
index 4427da9..1174109 100755
--- a/t/11_utils.t
+++ b/t/11_utils.t
@@ -20,10 +20,10 @@ with_temp_annexes {
my $annex = Git::Annex->new("source1");
my $unused_info = catfile($temp, qw(source1 .git annex unused_info));
- ok $annex->_git_path("blah", "foo")
- eq catfile($temp, qw(source1 .git blah foo)),
+ is $annex->_git_path("blah", "foo"),
+ catfile($temp, qw(source1 .git blah foo)),
"_git_path resolves a path";
- ok $annex->_unused_cache eq $unused_info,
+ is $annex->_unused_cache, $unused_info,
"_unused_cache resolves to correct path";
$annex->{_unused} = { foo => "bar" };
$annex->_store_unused_cache;
diff --git a/t/12_unused.t b/t/12_unused.t
index 55b6a9d..2a7b9bd 100755
--- a/t/12_unused.t
+++ b/t/12_unused.t
@@ -26,14 +26,14 @@ with_temp_annexes {
$annex->git->config(qw(annex.used-refspec +refs/heads/*));
my @unused = @{ $annex->unused };
- ok $annex->{_unused}{unused_args}{used_refspec} eq "+refs/heads/*",
+ is $annex->{_unused}{unused_args}{used_refspec}, "+refs/heads/*",
"uses configured annex.used-refspec";
$annex->git->config(qw(--unset annex.used-refspec));
@unused = @{ $annex->unused(used_refspec => "+refs/heads/*") };
- ok $annex->{_unused}{unused_args}{used_refspec} eq "+refs/heads/*",
+ is $annex->{_unused}{unused_args}{used_refspec}, "+refs/heads/*",
"uses passed used_refspec";
@unused = @{ $annex->unused };
- ok $annex->{_unused}{unused_args}{used_refspec} eq
+ is $annex->{_unused}{unused_args}{used_refspec},
"+refs/heads/*:-refs/heads/synced/*",
"uses default --used-refspec";