<commit_before>Feature: Flavorfile
  In order to gradually update existing Vim plugins,
  as a lazy Vim user,
  I want to reuse Vim plugins which contain old name of flavorfiles without problems.

  Scenario: User has old name of flavorfile is warned
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
    And an old name flavorfile with:
      """ruby
      flavor '$foo_uri'
      """
    When I run `vim-flavor install`
    Then it should pass with template:
      """
      Warning: Rename VimFlavor to Flavorfile.  VimFlavor wll be ignored in future version.
      Checking versions...
        Use $foo_uri ... 1.0.2
      Deploying plugins...
        $foo_uri 1.0.2 ... done
      Completed.
      """
    And a lockfile is created with:
      """
      $foo_uri (1.0.2)
      """
    And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"

  Scenario: User has both new and old name of flavorfile is warned
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
    And a repository "bar" with versions "2.0.0 2.0.1 2.0.2"
    And a flavorfile with:
      """ruby
      flavor '$bar_uri'
      """
    And an old name flavorfile with:
      """ruby
      flavor '$foo_uri'
      """
    When I run `vim-flavor install`
    Then it should pass with template:
      """
      Warning: Delete VimFlavor.  Flavorfile is being read instead.
      Checking versions...
        Use $bar_uri ... 2.0.2
      Deploying plugins...
        $bar_uri 2.0.2 ... done
      Completed.
      """
    And a lockfile is created with:
      """
      $bar_uri (2.0.2)
      """
      And a flavor "$foo_uri" is not deployed to "$home/.vim"
    And a flavor "$bar_uri" version "2.0.2" is deployed to "$home/.vim"

  Scenario: Plugin contains old name of flavorfile is not warned
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2" and an old name flavorfile:
      """ruby
      # No dependencies
      """
    And a flavorfile with:
      """ruby
      flavor '$foo_uri'
      """
    When I run `vim-flavor install`
    Then it should pass with template:
      """
      Checking versions...
        Use $foo_uri ... 1.0.2
      Deploying plugins...
        $foo_uri 1.0.2 ... done
      Completed.
      """
    And a lockfile is created with:
      """
      $foo_uri (1.0.2)
      """
    And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"

  Scenario: Testing a Vim plugin with old name flavorfile is warned
    Given a repository "kana/vim-vspec" from offline cache
    And an old name flavorfile with:
      """ruby
      # No dependencies
      """
    And a file named "plugin/foo.vim" with:
      """vim
      let g:foo = 3
      """
    And a file named "t/basics.vim" with:
      """vim
      " Tests are written with vim-vspec.
      runtime! plugin/foo.vim
      describe 'g:foo'
        it 'is equal to 3'
          Expect g:foo == 3
        end
      end
      """
    When I run `vim-flavor test`
    Then it should pass with regexp:
      """
      Warning: Rename VimFlavor to Flavorfile.  VimFlavor wll be ignored in future version.
      -------- Preparing dependencies
      Checking versions...
        Use kana/vim-vspec ... 1\.\d+(\.\d+)?
      Deploying plugins...
        kana/vim-vspec 1\.\d+(\.\d+)? ... done
      Completed.
      -------- Testing a Vim plugin
      t/basics.vim .. ok
      All tests successful.
      Files=1, Tests=1,  \d+ wallclock secs .*
      Result: PASS
      """
    And a lockfile is created and matches with:
      """
      kana/vim-vspec \(1\.\d+(\.\d+)?\)
      """
    And a dependency "kana/vim-vspec" is stored in ".vim-flavor/pack/flavors/start"

  Scenario: Testing a Vim plugin with both new and old name flavorfile is warned
    Given a repository "kana/vim-vspec" from offline cache
    And a flavorfile with:
      """ruby
      # No dependencies
      """
    And an old name flavorfile with:
      """ruby
      # No dependencies
      """
    And a file named "plugin/foo.vim" with:
      """vim
      let g:foo = 3
      """
    And a file named "t/basics.vim" with:
      """vim
      " Tests are written with vim-vspec.
      runtime! plugin/foo.vim
      describe 'g:foo'
        it 'is equal to 3'
          Expect g:foo == 3
        end
      end
      """
    When I run `vim-flavor test`
    Then it should pass with regexp:
      """
      Warning: Delete VimFlavor.  Flavorfile is being read instead.
      -------- Preparing dependencies
      Checking versions...
        Use kana/vim-vspec ... 1\.\d+(\.\d+)?
      Deploying plugins...
        kana/vim-vspec 1\.\d+(\.\d+)? ... done
      Completed.
      -------- Testing a Vim plugin
      t/basics.vim .. ok
      All tests successful.
      Files=1, Tests=1,  \d+ wallclock secs .*
      Result: PASS
      """
    And a lockfile is created and matches with:<commit_msg>Fix warning timing in scenarios on testing<commit_after>Feature: Flavorfile
  In order to gradually update existing Vim plugins,
  as a lazy Vim user,
  I want to reuse Vim plugins which contain old name of flavorfiles without problems.

  Scenario: User has old name of flavorfile is warned
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
    And an old name flavorfile with:
      """ruby
      flavor '$foo_uri'
      """
    When I run `vim-flavor install`
    Then it should pass with template:
      """
      Warning: Rename VimFlavor to Flavorfile.  VimFlavor wll be ignored in future version.
      Checking versions...
        Use $foo_uri ... 1.0.2
      Deploying plugins...
        $foo_uri 1.0.2 ... done
      Completed.
      """
    And a lockfile is created with:
      """
      $foo_uri (1.0.2)
      """
    And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"

  Scenario: User has both new and old name of flavorfile is warned
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2"
    And a repository "bar" with versions "2.0.0 2.0.1 2.0.2"
    And a flavorfile with:
      """ruby
      flavor '$bar_uri'
      """
    And an old name flavorfile with:
      """ruby
      flavor '$foo_uri'
      """
    When I run `vim-flavor install`
    Then it should pass with template:
      """
      Warning: Delete VimFlavor.  Flavorfile is being read instead.
      Checking versions...
        Use $bar_uri ... 2.0.2
      Deploying plugins...
        $bar_uri 2.0.2 ... done
      Completed.
      """
    And a lockfile is created with:
      """
      $bar_uri (2.0.2)
      """
      And a flavor "$foo_uri" is not deployed to "$home/.vim"
    And a flavor "$bar_uri" version "2.0.2" is deployed to "$home/.vim"

  Scenario: Plugin contains old name of flavorfile is not warned
    Given a repository "foo" with versions "1.0.0 1.0.1 1.0.2" and an old name flavorfile:
      """ruby
      # No dependencies
      """
    And a flavorfile with:
      """ruby
      flavor '$foo_uri'
      """
    When I run `vim-flavor install`
    Then it should pass with template:
      """
      Checking versions...
        Use $foo_uri ... 1.0.2
      Deploying plugins...
        $foo_uri 1.0.2 ... done
      Completed.
      """
    And a lockfile is created with:
      """
      $foo_uri (1.0.2)
      """
    And a flavor "$foo_uri" version "1.0.2" is deployed to "$home/.vim"

  Scenario: Testing a Vim plugin with old name flavorfile is warned
    Given a repository "kana/vim-vspec" from offline cache
    And an old name flavorfile with:
      """ruby
      # No dependencies
      """
    And a file named "plugin/foo.vim" with:
      """vim
      let g:foo = 3
      """
    And a file named "t/basics.vim" with:
      """vim
      " Tests are written with vim-vspec.
      runtime! plugin/foo.vim
      describe 'g:foo'
        it 'is equal to 3'
          Expect g:foo == 3
        end
      end
      """
    When I run `vim-flavor test`
    Then it should pass with regexp:
      """
      -------- Preparing dependencies
      Warning: Rename VimFlavor to Flavorfile.  VimFlavor wll be ignored in future version.
      Checking versions...
        Use kana/vim-vspec ... 1\.\d+(\.\d+)?
      Deploying plugins...
        kana/vim-vspec 1\.\d+(\.\d+)? ... done
      Completed.
      -------- Testing a Vim plugin
      t/basics.vim .. ok
      All tests successful.
      Files=1, Tests=1,  \d+ wallclock secs .*
      Result: PASS
      """
    And a lockfile is created and matches with:
      """
      kana/vim-vspec \(1\.\d+(\.\d+)?\)
      """
    And a dependency "kana/vim-vspec" is stored in ".vim-flavor/pack/flavors/start"

  Scenario: Testing a Vim plugin with both new and old name flavorfile is warned
    Given a repository "kana/vim-vspec" from offline cache
    And a flavorfile with:
      """ruby
      # No dependencies
      """
    And an old name flavorfile with:
      """ruby
      # No dependencies
      """
    And a file named "plugin/foo.vim" with:
      """vim
      let g:foo = 3
      """
    And a file named "t/basics.vim" with:
      """vim
      " Tests are written with vim-vspec.
      runtime! plugin/foo.vim
      describe 'g:foo'
        it 'is equal to 3'
          Expect g:foo == 3
        end
      end
      """
    When I run `vim-flavor test`
    Then it should pass with regexp:
      """
      -------- Preparing dependencies
      Warning: Delete VimFlavor.  Flavorfile is being read instead.
      Checking versions...
        Use kana/vim-vspec ... 1\.\d+(\.\d+)?
      Deploying plugins...
        kana/vim-vspec 1\.\d+(\.\d+)? ... done
      Completed.
      -------- Testing a Vim plugin
      t/basics.vim .. ok
      All tests successful.
      Files=1, Tests=1,  \d+ wallclock secs .*
      Result: PASS
      """
    And a lockfile is created and matches with:
{'fraction_non_alphanumeric': 0.11919171197045851, 'fraction_numerical': 0.0178479844086573, 'mean_word_length': 1.8073711488626547, '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': '4038276', 'n_tokens_mistral': 3231, 'n_tokens_neox': 3064, 'n_words': 1099}