<commit_before>Feature: Post Configuration Hook [#423]

  In order to extend Cucumber
  As a developer
  I want to manipulate the Cucumber configuration after it has been created

  Scenario: Using options directly gets a deprecation warning

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.options[:blah]
      end
      """
    When I run `cucumber features`
    Then the stderr should contain:
      """
      Deprecated
      """

  Scenario: Changing the output format
    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.formats << ['html', config.out_stream]
      end
      """
    When I run `cucumber features`
    Then the stderr should not contain anything
    And the output should contain:
      """
      html
      """

  Scenario: feature directories read from configuration

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.out_stream << "AfterConfiguration hook read feature directories: #{config.feature_dirs.join(', ')}" 
      end
      """
    When I run `cucumber features`
    Then the stderr should not contain anything
    And the output should contain:
      """
      AfterConfiguration hook read feature directories: features
      """
<commit_msg>Add spawn flag to Aruba scenario that requires it<commit_after>Feature: Post Configuration Hook [#423]

  In order to extend Cucumber
  As a developer
  I want to manipulate the Cucumber configuration after it has been created

  @spawn
  Scenario: Using options directly gets a deprecation warning

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.options[:blah]
      end
      """
    When I run `cucumber features`
    Then the stderr should contain:
      """
      Deprecated
      """

  Scenario: Changing the output format
    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.formats << ['html', config.out_stream]
      end
      """
    When I run `cucumber features`
    Then the stderr should not contain anything
    And the output should contain:
      """
      html
      """

  Scenario: feature directories read from configuration

    Given a file named "features/support/env.rb" with:
      """
      AfterConfiguration do |config|
        config.out_stream << "AfterConfiguration hook read feature directories: #{config.feature_dirs.join(', ')}" 
      end
      """
    When I run `cucumber features`
    Then the stderr should not contain anything
    And the output should contain:
      """
      AfterConfiguration hook read feature directories: features
      """

{'fraction_non_alphanumeric': 0.07813057438458794, 'fraction_numerical': 0.0021405636817695326, 'mean_word_length': 2.6321243523316062, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5517339', 'n_tokens_mistral': 745, 'n_tokens_neox': 710, 'n_words': 283}