<commit_before>require 'byebug'
require 'capybara/rails'
require 'capybara/rspec'
require 'database_cleaner'
require 'factory_girl_rails'
require 'fakeweb'
require 'ffaker'
require 'fuubar'
require 'launchy'
require 'letter_opener'
require 'rack-livereload'
require 'rspec-rails'
require 'shoulda-matchers'
require 'smithycms-auth'

Fog.mock! # this mocks out all AWS calls - really nice

RSpec.configure do |config|
  # configure Database cleaning
  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end
  config.before(:each) do |group|
    DatabaseCleaner.strategy = group.example.metadata[:type] == :feature ? :truncation : :transaction
    DatabaseCleaner.start
  end
  config.after(:each) do
    DatabaseCleaner.clean
  end
end<commit_msg>Updated to RSpec.current_example<commit_after>require 'byebug'
require 'capybara/rails'
require 'capybara/rspec'
require 'database_cleaner'
require 'factory_girl_rails'
require 'fakeweb'
require 'ffaker'
require 'fuubar'
require 'launchy'
require 'letter_opener'
require 'rack-livereload'
require 'shoulda-matchers'
require 'smithycms-auth'

Fog.mock! # this mocks out all AWS calls - really nice

RSpec.configure do |config|
  config.infer_spec_type_from_file_location!
  # configure Database cleaning
  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end
  config.before(:each) do |group|
    DatabaseCleaner.strategy = RSpec.current_example.metadata[:type] == :feature ? :truncation : :transaction
    DatabaseCleaner.start
  end
  config.after(:each) do
    DatabaseCleaner.clean
  end
end
{'fraction_non_alphanumeric': 0.09820359281437126, 'fraction_numerical': 0.0, 'mean_word_length': 5.501945525291829, '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': '4865137', 'n_tokens_mistral': 547, 'n_tokens_neox': 532, 'n_words': 128}