<commit_before>RSpec.configure do |config|
  config.filter_run :js_advanced => lambda { |val|
    !val or defined?(JRUBY_VERSION)
  }

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with :truncation
  end

  config.before(:each) do
    if example.metadata[:js]
      Capybara.current_driver = :selenium
      DatabaseCleaner.strategy = :truncation
    else
      DatabaseCleaner.strategy = :transaction
      DatabaseCleaner.start
    end
  end

  config.after(:each) do
    Capybara.use_default_driver if example.metadata[:js]
    DatabaseCleaner.clean
  end
end<commit_msg>Use celerity within capybara if running on jruby.<commit_after>RSpec.configure do |config|
  javascript_driver = defined?(JRUBY_VERSION) ? :celerity : :selenium

  config.filter_run :js_advanced => lambda { |val|
    !val or defined?(JRUBY_VERSION)
  }

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with :truncation
  end

  config.before(:each) do
    if example.metadata[:js]
      Capybara.current_driver = javascript_driver
      DatabaseCleaner.strategy = :truncation
    else
      DatabaseCleaner.strategy = :transaction
      DatabaseCleaner.start
    end
  end

  config.after(:each) do
    Capybara.use_default_driver if example.metadata[:js]
    DatabaseCleaner.clean
  end
end
{'fraction_non_alphanumeric': 0.08644688644688645, 'fraction_numerical': 0.0, 'mean_word_length': 3.726643598615917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1197456', 'n_tokens_mistral': 445, 'n_tokens_neox': 424, 'n_words': 88}