<commit_before><commit_msg>renamed<commit_after>#!/usr/bin/env shellspec

set -euo pipefail

Describe 'apps'
  Include resource/lib/cf-functions.sh

  setup() {
    initialize_source_config

    org=$(generate_test_name_with_spaces)
    space=$(generate_test_name_with_spaces)
    app_name=$(generate_test_name_with_hyphens)

    quiet create_org_and_space "$org" "$space"
    quiet login_for_test_assertions "$org" "$space"
  }

  teardown() {
    quiet delete_org_and_space "$org" "$space"
  }

  BeforeAll 'setup'
  AfterAll 'teardown'

  It 'can error if manifest not found'
    push_with_invalid_manifest() {
      local fixture=$(load_fixture "static-app")
      local params=$(
        %text:expand
        #|command: zero-downtime-push
        #|manifest: $fixture/does_not_exist.yml
      )
      put_with_params "$(yaml_to_json "$params")"
    }
    When call push_with_invalid_manifest
    The status should eq $E_MANIFEST_FILE_NOT_FOUND
    The output should json '.version | keys == ["timestamp"]'
    The error should match pattern "*invalid payload (manifest is not a file: */does_not_exist.yml*)"
  End
End
{'fraction_non_alphanumeric': 0.10606060606060606, 'fraction_numerical': 0.0, 'mean_word_length': 3.819742489270386, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1779452', 'n_tokens_mistral': 383, 'n_tokens_neox': 364, 'n_words': 82}