<commit_before>Feature: Caching
  In order to finish deployment as fast as possible,
  as a lazy Vim user,
  I want to cache repositories of plugins which are installed before.

  Background:
    Given a temporary directory called 'tmp'
    And a home directory called 'home' in '$tmp/home'
    And a repository 'foo' with versions '1.0.0 1.0.1 1.0.2'
    And flavorfile
      """ruby
      flavor '$foo_uri', '~> 1.0'
      """
    And I run `vim-flavor install`
    And I disable network to the original repository of 'foo'

  Scenario: Install plugins - locked and compatible with new flavorfile
    Given I delete '$home/.vim'
    When I run `vim-flavor install` again
    Then I get lockfile
      """
      $foo_uri (1.0.2)
      """
    And I get flavor '$foo_uri' with '1.0.2' in '$home/.vim'

  Scenario: Install plugins - locked but incompatible with new flavorfile
    Given I edit flavorfile as
      """ruby
      flavor '$foo_uri', '~> 2.0'
      """
    When I run `vim-flavor install`
    Then it fails with messages like
      """
      fatal: \S+ does not appear to be a git repository
      """

  Scenario: Install plugins - not locked
    Given I delete lockfile
    When I run `vim-flavor install`
    Then it fails with messages like
      """
      fatal: \S+ does not appear to be a git repository
      """

  Scenario: Upgrading plugins
    When I run `vim-flavor upgrade`
    Then it fails with messages like
      """
      fatal: \S+ does not appear to be a git repository
      """<commit_msg>Add "but" for failed commands<commit_after>Feature: Caching
  In order to finish deployment as fast as possible,
  as a lazy Vim user,
  I want to cache repositories of plugins which are installed before.

  Background:
    Given a temporary directory called 'tmp'
    And a home directory called 'home' in '$tmp/home'
    And a repository 'foo' with versions '1.0.0 1.0.1 1.0.2'
    And flavorfile
      """ruby
      flavor '$foo_uri', '~> 1.0'
      """
    And I run `vim-flavor install`
    And I disable network to the original repository of 'foo'

  Scenario: Install plugins - locked and compatible with new flavorfile
    Given I delete '$home/.vim'
    When I run `vim-flavor install` again
    Then I get lockfile
      """
      $foo_uri (1.0.2)
      """
    And I get flavor '$foo_uri' with '1.0.2' in '$home/.vim'

  Scenario: Install plugins - locked but incompatible with new flavorfile
    Given I edit flavorfile as
      """ruby
      flavor '$foo_uri', '~> 2.0'
      """
    When I run `vim-flavor install` but
    Then it fails with messages like
      """
      fatal: \S+ does not appear to be a git repository
      """

  Scenario: Install plugins - not locked
    Given I delete lockfile
    When I run `vim-flavor install` but
    Then it fails with messages like
      """
      fatal: \S+ does not appear to be a git repository
      """

  Scenario: Upgrading plugins
    When I run `vim-flavor upgrade` but
    Then it fails with messages like
      """
      fatal: \S+ does not appear to be a git repository
      """
{'fraction_non_alphanumeric': 0.08842652795838751, 'fraction_numerical': 0.01235370611183355, 'mean_word_length': 2.441834451901566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7186778', 'n_tokens_mistral': 932, 'n_tokens_neox': 893, 'n_words': 405}