#!/usr/bin/env bats load 'libs/bats-support/load' load 'libs/bats-assert/load' load 'helpers/common' @test "config.sh defines MAGICK_COMMENT" { run bash -c "source '$REPO_ROOT/config.sh' && echo \"\$MAGICK_COMMENT\"" assert_success assert_output "magick:resize=8mp,quality=85,sampling=4:2:0" } @test "config.sh defines MAX_PIXELS" { run bash -c "source '$REPO_ROOT/config.sh' && echo \"\$MAX_PIXELS\"" assert_success assert_output "8000000" } @test "MAGICK_COMMENT matches in images_resize.sh and zip_images_resize.sh" { local comment_from_config comment_in_resize comment_in_zip comment_from_config=$(bash -c "source '$REPO_ROOT/config.sh' && echo \"\$MAGICK_COMMENT\"") comment_in_resize=$(grep 'MAGICK_COMMENT=' "$REPO_ROOT/images_resize.sh" | grep -v source || true) comment_in_zip=$(grep 'MAGICK_COMMENT=' "$REPO_ROOT/zip_images_resize.sh" | grep -v source || true) # Neither script should define MAGICK_COMMENT itself — only config.sh should assert_equal "" "$comment_in_resize" assert_equal "" "$comment_in_zip" }