From 08232b74f6d512ab2ca7c08f67bb7c227b82a2ca Mon Sep 17 00:00:00 2001 From: p4u1 Date: Sun, 18 Feb 2024 20:40:58 +0100 Subject: [PATCH] partially fix tests/integration/app_cmd.bats --- tests/integration/app_cmd.bats | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/integration/app_cmd.bats b/tests/integration/app_cmd.bats index db2808ba..648d7cc3 100644 --- a/tests/integration/app_cmd.bats +++ b/tests/integration/app_cmd.bats @@ -58,7 +58,7 @@ test_cmd_export" assert_success assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE" - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local + run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' @@ -70,7 +70,7 @@ test_cmd_export" assert_success assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo" - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local + run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd assert_failure assert_output --partial 'locally unstaged changes' @@ -83,7 +83,7 @@ test_cmd_export" assert_success assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE/foo" - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --chaos + run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' @@ -96,14 +96,14 @@ test_cmd_export" assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial 'behind 3' + assert_output --partial "Your branch is behind 'origin/main' by 3 commits" - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local + run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - refute_output --partial 'behind 3' + assert_output --partial "Your branch is up to date with 'origin/main'" _reset_recipe "$TEST_RECIPE" } @@ -113,14 +113,14 @@ test_cmd_export" assert_success run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial 'behind 3' + assert_output --partial "Your branch is behind 'origin/main' by 3 commits" - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --offline + run $ABRA app cmd --local --offline "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status - assert_output --partial 'behind 3' + assert_output --partial "Your branch is behind 'origin/main' by 3 commits" _reset_recipe "$TEST_RECIPE" } @@ -132,13 +132,13 @@ test_cmd_export" } @test "error if missing arguments when passing --local" { - run $ABRA app cmd "$TEST_APP_DOMAIN" --local + run $ABRA app cmd --local "$TEST_APP_DOMAIN" assert_failure assert_output --partial 'missing arguments' } @test "cannot use --local and --user at same time" { - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --user root + run $ABRA app cmd --local --user root "$TEST_APP_DOMAIN" test_cmd assert_failure assert_output --partial 'cannot use --local & --user together' } @@ -147,7 +147,7 @@ test_cmd_export" run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh" assert_success - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local --chaos + run $ABRA app cmd --local --chaos "$TEST_APP_DOMAIN" test_cmd assert_failure assert_output --partial "$ABRA_DIR/recipes/$TEST_RECIPE/abra.sh does not exist" @@ -155,25 +155,25 @@ test_cmd_export" } @test "error if missing command" { - run $ABRA app cmd "$TEST_APP_DOMAIN" doesnt_exist --local + run $ABRA app cmd --local "$TEST_APP_DOMAIN" doesnt_exist assert_failure assert_output --partial "doesn't have a doesnt_exist function" } @test "run --local command" { - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd --local + run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd assert_success assert_output --partial 'baz' } @test "run command with single arg" { - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd_arg --local -- bing + run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_arg -- bing assert_success assert_output --partial 'bing' } @test "run command with several args" { - run $ABRA app cmd "$TEST_APP_DOMAIN" test_cmd_args --local -- bong bang + run $ABRA app cmd --local "$TEST_APP_DOMAIN" test_cmd_args -- bong bang assert_success assert_output --partial 'bong bang' }