<commit_before>require File.dirname(__FILE__) + '/../spec_helper'
require 'database_cleaner/active_record/transaction'
require 'database_cleaner/data_mapper/transaction'
require 'database_cleaner/mongo_mapper/truncation'
require 'database_cleaner/mongoid/truncation'
require 'database_cleaner/couch_potato/truncation'
require 'database_cleaner/neo4j/transaction'

module DatabaseCleaner
  describe Base do

    let(:mock_strategy) {
      mock("strategy").tap{|strategy|
        strategy.stub(:to_ary => [strategy])
      }
    }

    describe "autodetect" do

       #Cache all ORMs, we'll need them later but not now.
       before(:all) do
         Temp_AR = ::ActiveRecord if defined?(::ActiveRecord) and not defined?(Temp_AR)
         Temp_DM = ::DataMapper   if defined?(::DataMapper)   and not defined?(Temp_DM)
         Temp_MM = ::MongoMapper  if defined?(::MongoMapper)  and not defined?(Temp_MM)
         Temp_MO = ::Mongoid      if defined?(::Mongoid)      and not defined?(Temp_MO)
         Temp_CP = ::CouchPotato  if defined?(::CouchPotato)  and not defined?(Temp_CP)
         Temp_SQ = ::Sequel       if defined?(::Sequel)       and not defined?(Temp_SQ)
         Temp_MP = ::Moped        if defined?(::Moped)        and not defined?(Temp_MP)
         Temp_RS = ::Redis        if defined?(::Redis)        and not defined?(Temp_RS)
         Temp_OH = ::Ohm          if defined?(::Ohm)          and not defined?(Temp_OH)
         Temp_NJ = ::Neo4j        if defined?(::Neo4j)        and not defined?(Temp_NJ)
       end

       #Remove all ORM mocks and restore from cache
       after(:all) do<commit_msg>Rename deprecated RSpec method<commit_after>require File.dirname(__FILE__) + '/../spec_helper'
require 'database_cleaner/active_record/transaction'
require 'database_cleaner/data_mapper/transaction'
require 'database_cleaner/mongo_mapper/truncation'
require 'database_cleaner/mongoid/truncation'
require 'database_cleaner/couch_potato/truncation'
require 'database_cleaner/neo4j/transaction'

module DatabaseCleaner
  describe Base do

    let(:mock_strategy) {
      double("strategy").tap{|strategy|
        strategy.stub(:to_ary => [strategy])
      }
    }

    describe "autodetect" do

       #Cache all ORMs, we'll need them later but not now.
       before(:all) do
         Temp_AR = ::ActiveRecord if defined?(::ActiveRecord) and not defined?(Temp_AR)
         Temp_DM = ::DataMapper   if defined?(::DataMapper)   and not defined?(Temp_DM)
         Temp_MM = ::MongoMapper  if defined?(::MongoMapper)  and not defined?(Temp_MM)
         Temp_MO = ::Mongoid      if defined?(::Mongoid)      and not defined?(Temp_MO)
         Temp_CP = ::CouchPotato  if defined?(::CouchPotato)  and not defined?(Temp_CP)
         Temp_SQ = ::Sequel       if defined?(::Sequel)       and not defined?(Temp_SQ)
         Temp_MP = ::Moped        if defined?(::Moped)        and not defined?(Temp_MP)
         Temp_RS = ::Redis        if defined?(::Redis)        and not defined?(Temp_RS)
         Temp_OH = ::Ohm          if defined?(::Ohm)          and not defined?(Temp_OH)
         Temp_NJ = ::Neo4j        if defined?(::Neo4j)        and not defined?(Temp_NJ)
       end

       #Remove all ORM mocks and restore from cache
       after(:all) do
{'fraction_non_alphanumeric': 0.11169070266953053, 'fraction_numerical': 0.001841055538508745, 'mean_word_length': 2.975609756097561, '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': '3811868', 'n_tokens_mistral': 1029, 'n_tokens_neox': 1037, 'n_words': 242}