<commit_before>Feature: default_cassette_options

  The `default_cassette_options` configuration option takes a hash
  that provides defaults for each cassette you use.  Any cassette
  can override the defaults as well as set additional options.

  The `:match_requests_on` option defaults to `[:method, :uri]` when
  it has not been set.

  Background:
    Given a file named "vcr_setup.rb" with:
      """ruby
      require 'vcr'

      VCR.config do |c|
        c.default_cassette_options = { :record => :new_episodes, :erb => true }

        # not important for this example, but must be set to something
        c.stub_with :webmock
        c.cassette_library_dir = 'cassettes'
      end
      """

  Scenario: cassettes get default values from configured `default_cassette_options`
    Given a file named "default_cassette_options.rb" with:
      """ruby
      require 'vcr_setup.rb'

      VCR.use_cassette('example') do
        puts "Record Mode: #{VCR.current_cassette.record_mode}"
        puts "ERB: #{VCR.current_cassette.erb}"
      end
      """
    When I run `ruby default_cassette_options.rb`
    Then the output should contain:
      """
      Record Mode: new_episodes
      ERB: true<commit_msg>Add note about :once as default record mode.<commit_after>Feature: default_cassette_options

  The `default_cassette_options` configuration option takes a hash
  that provides defaults for each cassette you use.  Any cassette
  can override the defaults as well as set additional options.

  The `:match_requests_on` option defaults to `[:method, :uri]` when
  it has not been set.

  The `:record` option defaults to `:once` when it has not been set.

  Background:
    Given a file named "vcr_setup.rb" with:
      """ruby
      require 'vcr'

      VCR.config do |c|
        c.default_cassette_options = { :record => :new_episodes, :erb => true }

        # not important for this example, but must be set to something
        c.stub_with :webmock
        c.cassette_library_dir = 'cassettes'
      end
      """

  Scenario: cassettes get default values from configured `default_cassette_options`
    Given a file named "default_cassette_options.rb" with:
      """ruby
      require 'vcr_setup.rb'

      VCR.use_cassette('example') do
        puts "Record Mode: #{VCR.current_cassette.record_mode}"
        puts "ERB: #{VCR.current_cassette.erb}"
      end
      """
    When I run `ruby default_cassette_options.rb`
    Then the output should contain:
      """
      Record Mode: new_episodes
      ERB: true
{'fraction_non_alphanumeric': 0.08336625839589096, 'fraction_numerical': 0.0, 'mean_word_length': 2.9624413145539905, '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': '5896978', 'n_tokens_mistral': 801, 'n_tokens_neox': 777, 'n_words': 254}