<commit_before>Feature: Developer runs multiple substitutions
  As a Developer
  I want to run patch:up, minor:up and major:up commands
  With multiple substitutions

  Scenario: Running patch:up with multiple substitutions in verbose mode
    Given the file "stamp.yml" contains:
      """
      filename:    'metadata.json'
      regex:       '/"version" *: *"(?P<version>[^"]+)"/'
      replacement: '"version": "{{ version }}"'
      replacements:
          -
              filename:    'a.txt'
              regex:       '/New version ([\d\.]+)/'
              replacement: 'New version {{ version }}'
          -
              filename:    'b.yml'
              regex:       '/version: ([\d\.]+)/'
              replacement: 'version: {{ version }}'
      """
    And the file "metadata.json" contains:
      """
      {
        "version": "6.248.112",
      }
      """
    And the file "a.txt" contains:
      """
      New version 6.248.112
      """
    And the file "b.yml" contains:
      """
      version: 6.248.112
      """
    When I run command "patch:up" in verbose mode
    Then the output should contain:
      """
      parse_variable_from_file["filename"="metadata.json"]["version"="6.248.112"]
      patch_up["version"="6.248.113"]
      save_variable_to_file["version": "6.248.113"]
      save_variable_to_file[New version 6.248.113]
      save_variable_to_file[version: 6.248.113]
      command["git add metadata.json"]
      command["git commit -m "Version 6.248.113""]
      command["git tag -a v6.248.113 -m "Release 6.248.113""]
      """
    And the file "metadata.json" should contain:
      """
      {
        "version": "6.248.113",
      }
      """
    And the file "a.txt" should contain:
      """
      New version 6.248.113
      """
    And the file "b.yml" should contain:
      """
      version: 6.248.113
      """

  Scenario: Running minor:up with multiple substitutions in verbose mode
    Given the file "stamp.yml" contains:
      """
      filename:    'metadata.json'
      regex:       '/"version" *: *"(?P<version>[^"]+)"/'
      replacement: '"version": "{{ version }}"'
      replacements:
          -
              filename:    'a.txt'
              regex:       '/New version ([\d\.]+)/'
              replacement: 'New version {{ version }}'
          -
              filename:    'b.yml'
              regex:       '/version: ([\d\.]+)/'
              replacement: 'version: {{ version }}'
      """
    And the file "metadata.json" contains:
      """
      {
        "version": "6.248.112",
      }
      """
    And the file "a.txt" contains:
      """
      New version 6.248.112
      """
    And the file "b.yml" contains:
      """
      version: 6.248.112
      """
    When I run command "minor:up" in verbose mode
    Then the output should contain:
      """
      parse_variable_from_file["filename"="metadata.json"]["version"="6.248.112"]
      minor_up["version"="6.249.0"]
      save_variable_to_file["version": "6.249.0"]
      save_variable_to_file[New version 6.249.0]
      save_variable_to_file[version: 6.249.0]
      command["git add metadata.json"]
      command["git commit -m "Version 6.249.0""]
      command["git tag -a v6.249.0 -m "Release 6.249.0""]
      """
    And the file "metadata.json" should contain:
      """
      {
        "version": "6.249.0",
      }
      """
    And the file "a.txt" should contain:
      """
      New version 6.249.0
      """
    And the file "b.yml" should contain:
      """
      version: 6.249.0
      """

  Scenario: Running major:up with multiple substitutions in verbose mode
    Given the file "stamp.yml" contains:
      """
      filename:    'metadata.json'
      regex:       '/"version" *: *"(?P<version>[^"]+)"/'
      replacement: '"version": "{{ version }}"'
      replacements:
          -
              filename:    'a.txt'
              regex:       '/New version ([\d\.]+)/'
              replacement: 'New version {{ version }}'
          -
              filename:    'b.yml'
              regex:       '/version: ([\d\.]+)/'
              replacement: 'version: {{ version }}'
      """
    And the file "metadata.json" contains:
      """
      {
        "version": "6.248.112",
      }
      """
    And the file "a.txt" contains:
      """
      New version 6.248.112
      """
    And the file "b.yml" contains:
      """
      version: 6.248.112
      """
    When I run command "major:up" in verbose mode
    Then the output should contain:
      """
      parse_variable_from_file["filename"="metadata.json"]["version"="6.248.112"]
      major_up["version"="7.0.0"]
      save_variable_to_file["version": "7.0.0"]
      save_variable_to_file[New version 7.0.0]
      save_variable_to_file[version: 7.0.0]
      command["git add metadata.json"]
      command["git commit -m "Version 7.0.0""]
      command["git tag -a v7.0.0 -m "Release 7.0.0""]
      """
    And the file "metadata.json" should contain:
      """
      {
        "version": "7.0.0",
      }
      """
    And the file "a.txt" should contain:
      """
      New version 7.0.0
      """
    And the file "b.yml" should contain:
      """<commit_msg>Test multiple git add commands for multiple substitutions<commit_after>Feature: Developer runs multiple substitutions
  As a Developer
  I want to run patch:up, minor:up and major:up commands
  With multiple substitutions

  Scenario: Running patch:up with multiple substitutions in verbose mode
    Given the file "stamp.yml" contains:
      """
      filename:    'metadata.json'
      regex:       '/"version" *: *"(?P<version>[^"]+)"/'
      replacement: '"version": "{{ version }}"'
      replacements:
          -
              filename:    'a.txt'
              regex:       '/New version ([\d\.]+)/'
              replacement: 'New version {{ version }}'
          -
              filename:    'b.yml'
              regex:       '/version: ([\d\.]+)/'
              replacement: 'version: {{ version }}'
      """
    And the file "metadata.json" contains:
      """
      {
        "version": "6.248.112",
      }
      """
    And the file "a.txt" contains:
      """
      New version 6.248.112
      """
    And the file "b.yml" contains:
      """
      version: 6.248.112
      """
    When I run command "patch:up" in verbose mode
    Then the output should contain:
      """
      parse_variable_from_file["filename"="metadata.json"]["version"="6.248.112"]
      patch_up["version"="6.248.113"]
      save_variable_to_file["version": "6.248.113"]
      save_variable_to_file[New version 6.248.113]
      save_variable_to_file[version: 6.248.113]
      command["git add metadata.json"]
      command["git add a.txt"]
      command["git add b.yml"]
      command["git commit -m "Version 6.248.113""]
      command["git tag -a v6.248.113 -m "Release 6.248.113""]
      """
    And the file "metadata.json" should contain:
      """
      {
        "version": "6.248.113",
      }
      """
    And the file "a.txt" should contain:
      """
      New version 6.248.113
      """
    And the file "b.yml" should contain:
      """
      version: 6.248.113
      """

  Scenario: Running minor:up with multiple substitutions in verbose mode
    Given the file "stamp.yml" contains:
      """
      filename:    'metadata.json'
      regex:       '/"version" *: *"(?P<version>[^"]+)"/'
      replacement: '"version": "{{ version }}"'
      replacements:
          -
              filename:    'a.txt'
              regex:       '/New version ([\d\.]+)/'
              replacement: 'New version {{ version }}'
          -
              filename:    'b.yml'
              regex:       '/version: ([\d\.]+)/'
              replacement: 'version: {{ version }}'
      """
    And the file "metadata.json" contains:
      """
      {
        "version": "6.248.112",
      }
      """
    And the file "a.txt" contains:
      """
      New version 6.248.112
      """
    And the file "b.yml" contains:
      """
      version: 6.248.112
      """
    When I run command "minor:up" in verbose mode
    Then the output should contain:
      """
      parse_variable_from_file["filename"="metadata.json"]["version"="6.248.112"]
      minor_up["version"="6.249.0"]
      save_variable_to_file["version": "6.249.0"]
      save_variable_to_file[New version 6.249.0]
      save_variable_to_file[version: 6.249.0]
      command["git add metadata.json"]
      command["git add a.txt"]
      command["git add b.yml"]
      command["git commit -m "Version 6.249.0""]
      command["git tag -a v6.249.0 -m "Release 6.249.0""]
      """
    And the file "metadata.json" should contain:
      """
      {
        "version": "6.249.0",
      }
      """
    And the file "a.txt" should contain:
      """
      New version 6.249.0
      """
    And the file "b.yml" should contain:
      """
      version: 6.249.0
      """

  Scenario: Running major:up with multiple substitutions in verbose mode
    Given the file "stamp.yml" contains:
      """
      filename:    'metadata.json'
      regex:       '/"version" *: *"(?P<version>[^"]+)"/'
      replacement: '"version": "{{ version }}"'
      replacements:
          -
              filename:    'a.txt'
              regex:       '/New version ([\d\.]+)/'
              replacement: 'New version {{ version }}'
          -
              filename:    'b.yml'
              regex:       '/version: ([\d\.]+)/'
              replacement: 'version: {{ version }}'
      """
    And the file "metadata.json" contains:
      """
      {
        "version": "6.248.112",
      }
      """
    And the file "a.txt" contains:
      """
      New version 6.248.112
      """
    And the file "b.yml" contains:
      """
      version: 6.248.112
      """
    When I run command "major:up" in verbose mode
    Then the output should contain:
      """
      parse_variable_from_file["filename"="metadata.json"]["version"="6.248.112"]
      major_up["version"="7.0.0"]
      save_variable_to_file["version": "7.0.0"]
      save_variable_to_file[New version 7.0.0]
      save_variable_to_file[version: 7.0.0]
      command["git add metadata.json"]
      command["git add a.txt"]
      command["git add b.yml"]
      command["git commit -m "Version 7.0.0""]
      command["git tag -a v7.0.0 -m "Release 7.0.0""]
      """
    And the file "metadata.json" should contain:
      """
      {
        "version": "7.0.0",
      }
      """
    And the file "a.txt" should contain:
      """
      New version 7.0.0
      """
    And the file "b.yml" should contain:
      """
{'fraction_non_alphanumeric': 0.15815361331819902, 'fraction_numerical': 0.04370034052213394, 'mean_word_length': 1.8104731525784157, 'pattern_counts': {'":': 24, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1785005', 'n_tokens_mistral': 3619, 'n_tokens_neox': 3307, 'n_words': 811}