<commit_before>require "minitest/rails"
# Load minitest-capybara and minitest-matchers
require "minitest-capybara"
require "capybara/rails"
require "minitest/metadata"

module Capybara
  module Rails
    class Helpers # :nodoc:
      include ::Rails.application.routes.url_helpers
      include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to? :mounted_helpers
      def initialize
        self.default_url_options = ::Rails.application.routes.default_url_options
        self.default_url_options[:host] ||= "test.local"
      end
    end
    class TestCase < ::ActiveSupport::TestCase
      include Capybara::DSL
      include Capybara::Assertions
      include Minitest::Metadata

      # Register by name
      register_spec_type(/(Feature|Browser)( ?Test)?\z/i, self)
      register_spec_type(self) do |desc, *addl|
        addl.include? :capybara
      end

      # Enable Capybara's spec DSL
      class << self
        alias :feature    :describe
        alias :background :before
        alias :scenario   :it
        alias :given      :let
      end

      # Configure the driver using metadata
      before do
        if metadata[:js] == true
          Capybara.current_driver = Capybara.javascript_driver
        end
      end

      after do
        Capybara.reset_sessions!
        Capybara.use_default_driver
      end

      # Defer rails helpers methods to a different object
      def __rails_helpers__ # :nodoc:
        @__rails_helpers__ ||= ::Capybara::Rails::Helpers.new
      end
      def respond_to?(method, include_private = false) # :nodoc:
        __rails_helpers__.respond_to?(method, include_private) || super
      end
      def method_missing(sym, *args, &block) # :nodoc:
        if __rails_helpers__.respond_to?(sym, true)
          __rails_helpers__.__send__(sym, *args, &block)
        else
          super
        end
      end
    end
  end
end

# Add feature to main object
def feature desc, *addl, &blk # :nodoc:
    addl << :capybara
    describe desc, addl, &blk
end

module Capybara<commit_msg>Revert "Update Capybara's feature DSL implementation"<commit_after>require "minitest/rails"
# Load minitest-capybara and minitest-matchers
require "minitest-capybara"
require "capybara/rails"
require "minitest/metadata"

module Capybara
  module Rails
    class Helpers # :nodoc:
      include ::Rails.application.routes.url_helpers
      include ::Rails.application.routes.mounted_helpers if ::Rails.application.routes.respond_to? :mounted_helpers
      def initialize
        self.default_url_options = ::Rails.application.routes.default_url_options
        self.default_url_options[:host] ||= "test.local"
      end
    end
    class TestCase < ::ActiveSupport::TestCase
      include Capybara::DSL
      include Capybara::Assertions
      include Minitest::Metadata

      # Register by name
      register_spec_type(/(Feature|Browser)( ?Test)?\z/i, self)
      register_spec_type(self) do |desc, *addl|
        addl.include? :capybara
      end

      # Enable Capybara's spec DSL
      class << self
        alias :background :before
        alias :scenario   :it
        alias :given      :let
      end

      # Configure the driver using metadata
      before do
        if metadata[:js] == true
          Capybara.current_driver = Capybara.javascript_driver
        end
      end

      after do
        Capybara.reset_sessions!
        Capybara.use_default_driver
      end

      # Defer rails helpers methods to a different object
      def __rails_helpers__ # :nodoc:
        @__rails_helpers__ ||= ::Capybara::Rails::Helpers.new
      end
      def respond_to?(method, include_private = false) # :nodoc:
        __rails_helpers__.respond_to?(method, include_private) || super
      end
      def method_missing(sym, *args, &block) # :nodoc:
        if __rails_helpers__.respond_to?(sym, true)
          __rails_helpers__.__send__(sym, *args, &block)
        else
          super
        end
      end
    end
  end
end

module Kernel # :nodoc:
  def feature desc, &blk
    describe "#{desc} Feature Test", &blk
  end
end

module Capybara
{'fraction_non_alphanumeric': 0.08608147429679923, 'fraction_numerical': 0.0, 'mean_word_length': 2.676470588235294, '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': '2465088', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1262, 'n_words': 307}