summaryrefslogtreecommitdiff
path: root/test/cases/librestage.bats
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/librestage.bats')
-rw-r--r--test/cases/librestage.bats25
1 files changed, 10 insertions, 15 deletions
diff --git a/test/cases/librestage.bats b/test/cases/librestage.bats
index 2fe3415..1bc5c25 100644
--- a/test/cases/librestage.bats
+++ b/test/cases/librestage.bats
@@ -1,9 +1,6 @@
-#!/usr/bin/env roundup
+load ../lib/common
-describe librestage
-. ./test-common.sh
-
-it_displays_usage_text() {
+@test "librestage displays usage text" {
rm -rf "$XDG_CONFIG_HOME"
LC_ALL=C librestage -h >$tmpdir/stdout 2>$tmpdir/stderr
@@ -11,7 +8,7 @@ it_displays_usage_text() {
empty "$tmpdir/stderr"
}
-it_fails_with_0_args() {
+@test "librestage fails with 0 args" {
librestage >$tmpdir/stdout 2>$tmpdir/stderr || status=$?
[[ $status != 0 ]]
@@ -19,7 +16,7 @@ it_fails_with_0_args() {
not empty "$tmpdir/stderr"
}
-it_fails_with_invalid_args() {
+@test "librestage fails with invalid args" {
librestage -q >$tmpdir/stdout 2>$tmpdir/stderr || status=$?
[[ $status != 0 ]]
@@ -27,17 +24,16 @@ it_fails_with_invalid_args() {
not empty "$tmpdir/stderr"
}
-it_guesses_the_repo() {
+@test "librestage guesses the repo" {
nochroot=false; require network sudo || nochroot=true
mkdir -p -- "$tmpdir/reponame/libretools-hello"
- cp librestage.d/PKGBUILD-hello "$tmpdir/reponame/libretools-hello/PKGBUILD"
+ cp fixtures/librestage/PKGBUILD-hello "$tmpdir/reponame/libretools-hello/PKGBUILD"
cd "$tmpdir/reponame/libretools-hello"
if $nochroot; then
makepkg
else
- libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
- testsudo libremakepkg -l "$roundup_test_name"
+ testsudo libremakepkg -l "$BATS_TEST_NAME"
fi
librestage
@@ -46,7 +42,7 @@ it_guesses_the_repo() {
$nochroot || globfile $tmpdir/workdir/staging/sources/parabola/libretools-hello-1.0-1-any.src.tar.?z
}
-it_stages_packages_without_PKGDEST() {
+@test "librestage stages packages without PKGDEST" {
nochroot=false; require network sudo || nochroot=true
cat >> "$XDG_CONFIG_HOME/pacman/makepkg.conf" <<-eot
@@ -54,14 +50,13 @@ it_stages_packages_without_PKGDEST() {
SRCPKGDEST=''
eot
- cp librestage.d/PKGBUILD-hello "$tmpdir/PKGBUILD"
+ cp fixtures/librestage/PKGBUILD-hello "$tmpdir/PKGBUILD"
cd "$tmpdir"
if $nochroot; then
makepkg
else
- libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
- testsudo libremakepkg -l "$roundup_test_name"
+ testsudo libremakepkg -l "$BATS_TEST_NAME"
fi
librestage repo1