diff --git a/Gemfile b/Gemfile
index 6328404..7e55a3b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,15 +1,2 @@
gemspec
-path "./adapters" do
- gem "database_cleaner-active_record"
- gem "database_cleaner-couch_potato"
- gem "database_cleaner-data_mapper"
- gem "database_cleaner-mongo"
- gem "database_cleaner-mongoid"
- gem "database_cleaner-mongo_mapper"
- gem "database_cleaner-moped"
- gem "database_cleaner-neo4j"
- gem "database_cleaner-ohm"
- gem "database_cleaner-redis"
- gem "database_cleaner-sequel"
-end
diff --git a/Gemfile.lock b/Gemfile.lock
index b9cbd9e..ee56f50 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,47 +1,7 @@
PATH
remote: .
specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: adapters
- specs:
- database_cleaner-active_record (1.8.0)
- activerecord
- database_cleaner (~> 1.8.0)
- database_cleaner-couch_potato (1.8.0)
- couch_potato
- database_cleaner (~> 1.8.0)
- database_cleaner-data_mapper (1.8.0)
- database_cleaner (~> 1.8.0)
- datamapper
- dm-transactions
- database_cleaner-mongo (1.8.0)
- database_cleaner (~> 1.8.0)
- mongo
- database_cleaner-mongo_mapper (1.8.1)
- database_cleaner (~> 1.8.0)
- mongo_mapper
- database_cleaner-mongoid (1.8.1)
- database_cleaner (~> 1.8.0)
- database_cleaner-mongo (~> 1.8.0)
- mongoid
- database_cleaner-moped (1.8.0)
- database_cleaner (~> 1.8.0)
- moped
- database_cleaner-neo4j (1.8.0)
- database_cleaner (~> 1.8.0)
- neo4j-core
- database_cleaner-ohm (1.8.1)
- database_cleaner (~> 1.8.0)
- database_cleaner-redis (~> 1.8.0)
- ohm
- database_cleaner-redis (1.8.0)
- database_cleaner (~> 1.8.0)
- redis
- database_cleaner-sequel (1.8.0)
- database_cleaner (~> 1.8.0)
- sequel
+ database_cleaner (2.0.0.beta)
GEM
remote: https://rubygems.org/
@@ -287,17 +247,6 @@ DEPENDENCIES
couch_potato
cucumber
database_cleaner!
- database_cleaner-active_record!
- database_cleaner-couch_potato!
- database_cleaner-data_mapper!
- database_cleaner-mongo!
- database_cleaner-mongo_mapper!
- database_cleaner-mongoid!
- database_cleaner-moped!
- database_cleaner-neo4j!
- database_cleaner-ohm!
- database_cleaner-redis!
- database_cleaner-sequel!
datamapper
dm-migrations
dm-sqlite-adapter
diff --git a/Rakefile b/Rakefile
index ffc098f..e262d78 100644
--- a/Rakefile
+++ b/Rakefile
@@ -18,16 +18,7 @@ end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
-desc "Run adapter test suites"
-task :adapters do
- Dir["adapters/*"].each do |adapter_dir|
- Dir.chdir adapter_dir do
- sh "bundle exec rake"
- end
- end
-end
-
-task :default => [:spec, :features, :adapters]
+task :default => [:spec, :features]
desc "Cleans the project of any tmp file that should not be included in the gemspec."
task :clean do
diff --git a/adapters/database_cleaner-active_record/.gitignore b/adapters/database_cleaner-active_record/.gitignore
deleted file mode 100644
index a2164d5..0000000
--- a/adapters/database_cleaner-active_record/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/spec/support/config.yml
-/tmp/
-!/tmp/.keep
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-active_record/.rspec b/adapters/database_cleaner-active_record/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-active_record/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-active_record/.travis.yml b/adapters/database_cleaner-active_record/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-active_record/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-active_record/Gemfile b/adapters/database_cleaner-active_record/Gemfile
deleted file mode 100644
index ac29054..0000000
--- a/adapters/database_cleaner-active_record/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-active_record.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-active_record/Gemfile.lock b/adapters/database_cleaner-active_record/Gemfile.lock
deleted file mode 100644
index 70790e5..0000000
--- a/adapters/database_cleaner-active_record/Gemfile.lock
+++ /dev/null
@@ -1,73 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-active_record (1.8.0)
- activerecord
- database_cleaner (~> 1.8.0)
-
-GEM
- remote: https://rubygems.org/
- specs:
- activemodel (5.2.4.1)
- activesupport (= 5.2.4.1)
- activerecord (5.2.4.1)
- activemodel (= 5.2.4.1)
- activesupport (= 5.2.4.1)
- arel (>= 9.0)
- activerecord-mysql2-adapter (0.0.3)
- mysql2
- activesupport (5.2.4.1)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- arel (9.0.0)
- concurrent-ruby (1.1.5)
- diff-lcs (1.3)
- i18n (1.5.1)
- concurrent-ruby (~> 1.0)
- minitest (5.14.0)
- mysql (2.9.1)
- mysql2 (0.3.18)
- pg (0.18.2)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- sqlite3 (1.3.10)
- thread_safe (0.3.6)
- tzinfo (1.2.6)
- thread_safe (~> 0.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- activerecord-mysql2-adapter
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-active_record!
- mysql (~> 2.9.1)
- mysql2
- pg
- rake (~> 10.0)
- rspec (~> 3.0)
- sqlite3
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-active_record/LICENSE.txt b/adapters/database_cleaner-active_record/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-active_record/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-active_record/README.md b/adapters/database_cleaner-active_record/README.md
deleted file mode 100644
index 9e66ece..0000000
--- a/adapters/database_cleaner-active_record/README.md
+++ /dev/null
@@ -1,110 +0,0 @@
-# Database Cleaner Adapter for ActiveRecord
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-active_record.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-active_record)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-active_record/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-active_record)
-
-Clean your ActiveRecord databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-active_record'
-end
-```
-
-## Supported Strategies
-
-Here is an overview of the supported strategies:
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- Yes |
- Yes |
-
-
-
-
-(Default strategy is denoted in bold)
-
-For support or to discuss development please use the [Google Group](https://groups.google.com/group/database_cleaner).
-
-## What strategy is fastest?
-
-For the SQL libraries the fastest option will be to use `:transaction` as transactions are simply rolled back. If you can use this strategy you should. However, if you wind up needing to use multiple database connections in your tests (i.e. your tests run in a different process than your application) then using this strategy becomes a bit more difficult. You can get around the problem a number of ways.
-
-One common approach is to force all processes to use the same database connection ([common ActiveRecord hack](http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/)) however this approach has been reported to result in non-deterministic failures.
-
-Another approach is to have the transactions rolled back in the application's process and relax the isolation level of the database (so the tests can read the uncommitted transactions).
-
-An easier, but slower, solution is to use the `:truncation` or `:deletion` strategy.
-
-So what is fastest out of `:deletion` and `:truncation`? Well, it depends on your table structure and what percentage of tables you populate in an average test. The reasoning is out of the scope of this README but here is a [good SO answer on this topic for Postgres](https://stackoverflow.com/questions/11419536/postgresql-truncation-speed/11423886#11423886).
-
-Some people report much faster speeds with `:deletion` while others say `:truncation` is faster for them. The best approach therefore is it try all options on your test suite and see what is faster.
-
-If you are using ActiveRecord then take a look at the [additional options](#additional-activerecord-options-for-truncation) available for `:truncation`.
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Active Record |
- DatabaseCleaner[:active_record] |
- Connection specified as :symbol keys, loaded from config/database.yml . You may also pass in the ActiveRecord model under the :model key. |
-
-
-
-
-### Additional ActiveRecord options for Truncation
-
-The following options are available for ActiveRecord's `:truncation` strategy _only_ for MySQL and Postgres.
-
-* `:pre_count` - When set to `true` this will check each table for existing rows before truncating it. This can speed up test suites when many of the tables to be truncated are never populated. Defaults to `:false`. (Also, see the section on [What strategy is fastest?](#what-strategy-is-fastest))
-* `:reset_ids` - This only matters when `:pre_count` is used, and it will make sure that a tables auto-incrementing id is reset even if there are no rows in the table (e.g. records were created in the test but also removed before DatabaseCleaner gets to it). Defaults to `true`.
-
-The following option is available for ActiveRecord's `:truncation` and `:deletion` strategy for any DB.
-
-* `:cache_tables` - When set to `true` the list of tables to truncate or delete from will only be read from the DB once, otherwise it will be read before each cleanup run. Set this to `false` if (1) you create and drop tables in your tests, or (2) you change Postgres schemas (`ActiveRecord::Base.connection.schema_search_path`) in your tests (for example, in a multitenancy setup with each tenant in a different Postgres schema). Defaults to `true`.
-
-
-## Common Errors
-
-### STDERR is being flooded when using Postgres
-
-If you are using Postgres and have foreign key constraints, the truncation strategy will cause a lot of extra noise to appear on STDERR (in the form of "NOTICE truncate cascades" messages).
-
-To silence these warnings set the following log level in your `postgresql.conf` file:
-
-```ruby
-client_min_messages = warning
-```
-
-For ActiveRecord, you add the following parameter in your database.yml file:
-
-
-test:
- adapter: postgresql
- # ...
- min_messages: WARNING
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-active_record/Rakefile b/adapters/database_cleaner-active_record/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-active_record/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-active_record/bin/console b/adapters/database_cleaner-active_record/bin/console
deleted file mode 100755
index 90ef12a..0000000
--- a/adapters/database_cleaner-active_record/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/active_record"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-active_record/bin/setup b/adapters/database_cleaner-active_record/bin/setup
deleted file mode 100755
index 268b1b4..0000000
--- a/adapters/database_cleaner-active_record/bin/setup
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-cp spec/support/sample.config.yml spec/support/config.yml
-
diff --git a/adapters/database_cleaner-active_record/database_cleaner-active_record.gemspec b/adapters/database_cleaner-active_record/database_cleaner-active_record.gemspec
deleted file mode 100644
index 2b0d6d7..0000000
--- a/adapters/database_cleaner-active_record/database_cleaner-active_record.gemspec
+++ /dev/null
@@ -1,40 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/active_record/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-active_record"
- spec.version = DatabaseCleaner::ActiveRecord::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-active_record"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "activerecord"
-
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rspec", "~> 3.0"
-
- unless RUBY_PLATFORM =~ /java/
- spec.add_development_dependency 'mysql', '~> 2.9.1'
- spec.add_development_dependency 'mysql2'
- spec.add_development_dependency "activerecord-mysql2-adapter"
- spec.add_development_dependency 'pg'
- spec.add_development_dependency "sqlite3"
- else
- spec.add_development_dependency "activerecord-jdbc-adapter"
- end
-end
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner-active_record.rb b/adapters/database_cleaner-active_record/lib/database_cleaner-active_record.rb
deleted file mode 100644
index ad7a57b..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner-active_record.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/active_record"
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record.rb b/adapters/database_cleaner-active_record/lib/database_cleaner/active_record.rb
deleted file mode 100644
index f90e80a..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'database_cleaner/active_record/version'
-require 'database_cleaner'
-require 'database_cleaner/active_record/deletion'
-require 'database_cleaner/active_record/transaction'
-require 'database_cleaner/active_record/truncation'
-
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/base.rb b/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/base.rb
deleted file mode 100644
index 8bf8102..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/base.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require 'active_record'
-require 'database_cleaner/generic/base'
-require 'erb'
-require 'yaml'
-
-module DatabaseCleaner
- module ActiveRecord
- def self.available_strategies
- %w[truncation transaction deletion]
- end
-
- def self.default_strategy
- :transaction
- end
-
- def self.config_file_location=(path)
- @config_file_location = path
- end
-
- def self.config_file_location
- @config_file_location ||= begin
- # Has DC.app_root been set? Check in this intrusive way to avoid triggering deprecation warnings if it hasn't.
- app_root = DatabaseCleaner.send(:configuration).instance_variable_get(:@app_root)
- root = app_root || Dir.pwd
- "#{root}/config/database.yml"
- end
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- attr_accessor :connection_hash
-
- def db=(desired_db)
- @db = desired_db
- load_config
- end
-
- def db
- @db ||= super
- end
-
- def load_config
- if self.db != :default && self.db.is_a?(Symbol) && File.file?(ActiveRecord.config_file_location)
- connection_details = YAML::load(ERB.new(IO.read(ActiveRecord.config_file_location)).result)
- @connection_hash = valid_config(connection_details)[self.db.to_s]
- end
- end
-
- def valid_config(connection_file)
- if !::ActiveRecord::Base.configurations.nil? && !::ActiveRecord::Base.configurations.empty?
- if connection_file != ::ActiveRecord::Base.configurations
- return ::ActiveRecord::Base.configurations
- end
- end
- connection_file
- end
-
- def connection_class
- @connection_class ||= if db && !db.is_a?(Symbol)
- db
- elsif connection_hash
- lookup_from_connection_pool || establish_connection
- else
- ::ActiveRecord::Base
- end
- end
-
- def self.migration_table_name
- if ::ActiveRecord::VERSION::MAJOR < 5
- ::ActiveRecord::Migrator.schema_migrations_table_name
- else
- ::ActiveRecord::SchemaMigration.table_name
- end
- end
-
- def self.exclusion_condition(column_name)
- result = " #{column_name} <> '#{::DatabaseCleaner::ActiveRecord::Base.migration_table_name}' "
- if ::ActiveRecord::VERSION::MAJOR >= 5
- result += " AND #{column_name} <> '#{::ActiveRecord::Base.internal_metadata_table_name}' "
- end
- result
- end
-
- private
-
- def lookup_from_connection_pool
- if ::ActiveRecord::Base.respond_to?(:descendants)
- database_name = connection_hash["database"] || connection_hash[:database]
- models = ::ActiveRecord::Base.descendants
- models.select(&:connection_pool).detect { |m| m.connection_pool.spec.config[:database] == database_name }
- end
- end
-
- def establish_connection
- ::ActiveRecord::Base.establish_connection(connection_hash)
- ::ActiveRecord::Base
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/deletion.rb b/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/deletion.rb
deleted file mode 100644
index 09d9394..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/deletion.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-require 'active_record'
-require 'active_record/connection_adapters/abstract_adapter'
-require "database_cleaner/generic/truncation"
-require 'database_cleaner/active_record/truncation'
-
-module DatabaseCleaner
- module ConnectionAdapters
- module AbstractDeleteAdapter
- def delete_table(table_name)
- raise NotImplementedError
- end
- end
-
- module GenericDeleteAdapter
- def delete_table(table_name)
- execute("DELETE FROM #{quote_table_name(table_name)};")
- end
- end
-
- module OracleDeleteAdapter
- def delete_table(table_name)
- execute("DELETE FROM #{quote_table_name(table_name)}")
- end
- end
- end
-end
-
-module ActiveRecord
- module ConnectionAdapters
- AbstractAdapter.class_eval { include DatabaseCleaner::ConnectionAdapters::AbstractDeleteAdapter }
-
- JdbcAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(JdbcAdapter)
- AbstractMysqlAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(AbstractMysqlAdapter)
- Mysql2Adapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(Mysql2Adapter)
- SQLiteAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(SQLiteAdapter)
- SQLite3Adapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(SQLite3Adapter)
- PostgreSQLAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(PostgreSQLAdapter)
- IBM_DBAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(IBM_DBAdapter)
- SQLServerAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::GenericDeleteAdapter } if defined?(SQLServerAdapter)
- OracleEnhancedAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::OracleDeleteAdapter } if defined?(OracleEnhancedAdapter)
- end
-end
-
-module DatabaseCleaner::ActiveRecord
- module SelectiveTruncation
- def tables_to_truncate(connection)
- if information_schema_exists?(connection)
- (@only || tables_with_new_rows(connection)) - @tables_to_exclude
- else
- super
- end
- end
-
- def tables_with_new_rows(connection)
- stats = table_stats_query(connection)
- if stats != ''
- connection.select_values(stats)
- else
- []
- end
- end
-
- def table_stats_query(connection)
- @table_stats_query ||= build_table_stats_query(connection)
- ensure
- @table_stats_query = nil unless @cache_tables
- end
-
- def build_table_stats_query(connection)
- tables = connection.select_values(<<-SQL)
- SELECT table_name
- FROM information_schema.tables
- WHERE table_schema = database()
- AND #{::DatabaseCleaner::ActiveRecord::Base.exclusion_condition('table_name')};
- SQL
- queries = tables.map do |table|
- "(SELECT #{connection.quote(table)} FROM #{connection.quote_table_name(table)} LIMIT 1)"
- end
- queries.join(' UNION ALL ')
- end
-
- def information_schema_exists? connection
- return false unless connection.is_a? ActiveRecord::ConnectionAdapters::Mysql2Adapter
- @information_schema_exists ||=
- begin
- connection.execute("SELECT 1 FROM information_schema.tables")
- true
- rescue
- false
- end
- end
- end
-
- class Deletion < Truncation
- if defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
- include SelectiveTruncation
- end
-
- def clean
- connection = connection_class.connection
- connection.disable_referential_integrity do
- tables_to_truncate(connection).each do |table_name|
- connection.delete_table table_name
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/transaction.rb b/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/transaction.rb
deleted file mode 100644
index 540011a..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/transaction.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'database_cleaner/active_record/base'
-require 'database_cleaner/generic/transaction'
-
-module DatabaseCleaner::ActiveRecord
- class Transaction
- include ::DatabaseCleaner::ActiveRecord::Base
- include ::DatabaseCleaner::Generic::Transaction
-
- def start
- # Hack to make sure that the connection is properly setup for
- # the clean code.
- connection_class.connection.transaction{ }
-
- if connection_maintains_transaction_count?
- if connection_class.connection.respond_to?(:increment_open_transactions)
- connection_class.connection.increment_open_transactions
- else
- connection_class.__send__(:increment_open_transactions)
- end
- end
- if connection_class.connection.respond_to?(:begin_transaction)
- connection_class.connection.begin_transaction :joinable => false
- else
- connection_class.connection.begin_db_transaction
- end
- end
-
-
- def clean
- connection_class.connection_pool.connections.each do |connection|
- next unless connection.open_transactions > 0
-
- if connection.respond_to?(:rollback_transaction)
- connection.rollback_transaction
- else
- connection.rollback_db_transaction
- end
-
- # The below is for handling after_commit hooks.. see https://github.com/bmabey/database_cleaner/issues/99
- if connection.respond_to?(:rollback_transaction_records, true)
- connection.send(:rollback_transaction_records, true)
- end
-
- if connection_maintains_transaction_count?
- if connection.respond_to?(:decrement_open_transactions)
- connection.decrement_open_transactions
- else
- connection_class.__send__(:decrement_open_transactions)
- end
- end
- end
- end
-
- def connection_maintains_transaction_count?
- ActiveRecord::VERSION::MAJOR < 4
- end
-
- end
-end
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/truncation.rb b/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/truncation.rb
deleted file mode 100644
index ed13853..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/truncation.rb
+++ /dev/null
@@ -1,280 +0,0 @@
-require 'active_record/base'
-require 'database_cleaner/active_record/base'
-require 'active_record/connection_adapters/abstract_adapter'
-
-#Load available connection adapters
-%w(
- abstract_mysql_adapter postgresql_adapter sqlite3_adapter mysql_adapter mysql2_adapter oracle_enhanced_adapter
-).each do |known_adapter|
- begin
- require "active_record/connection_adapters/#{known_adapter}"
- rescue LoadError
- end
-end
-
-require "database_cleaner/generic/truncation"
-require 'database_cleaner/active_record/base'
-
-module DatabaseCleaner
- module ConnectionAdapters
-
- module AbstractAdapter
- # used to be called views but that can clash with gems like schema_plus
- # this gem is not meant to be exposing such an extra interface any way
- def database_cleaner_view_cache
- @views ||= select_values("select table_name from information_schema.views where table_schema = '#{current_database}'") rescue []
- end
-
- def database_cleaner_table_cache
- # the adapters don't do caching (#130) but we make the assumption that the list stays the same in tests
- @database_cleaner_tables ||= database_tables
- end
-
- def database_tables
- ::ActiveRecord::VERSION::MAJOR >= 5 ? data_sources : tables
- end
-
- def truncate_table(table_name)
- raise NotImplementedError
- end
-
- def truncate_tables(tables)
- tables.each do |table_name|
- self.truncate_table(table_name)
- end
- end
- end
-
- module AbstractMysqlAdapter
- def truncate_table(table_name)
- execute("TRUNCATE TABLE #{quote_table_name(table_name)};")
- end
-
- def truncate_tables(tables)
- tables.each { |t| truncate_table(t) }
- end
-
- def pre_count_truncate_tables(tables, options = {:reset_ids => true})
- filter = options[:reset_ids] ? method(:has_been_used?) : method(:has_rows?)
- truncate_tables(tables.select(&filter))
- end
-
- private
-
- def row_count(table)
- # Patch for MysqlAdapter with ActiveRecord 3.2.7 later
- # select_value("SELECT 1") #=> "1"
- select_value("SELECT EXISTS (SELECT 1 FROM #{quote_table_name(table)} LIMIT 1)").to_i
- end
-
- def auto_increment_value(table)
- select_value(<<-SQL).to_i
- SELECT auto_increment
- FROM information_schema.tables
- WHERE table_name = '#{table}'
- AND table_schema = database()
- SQL
- end
-
- # This method tells us if the given table has been inserted into since its
- # last truncation. Note that the table might have been populated, which
- # increased the auto-increment counter, but then cleaned again such that
- # it appears empty now.
- def has_been_used?(table)
- has_rows?(table) || auto_increment_value(table) > 1
- end
-
- def has_rows?(table)
- row_count(table) > 0
- end
- end
-
- module IBM_DBAdapter
- def truncate_table(table_name)
- execute("TRUNCATE #{quote_table_name(table_name)} IMMEDIATE")
- end
- end
-
- module SQLiteAdapter
- def delete_table(table_name)
- execute("DELETE FROM #{quote_table_name(table_name)};")
- if uses_sequence
- execute("DELETE FROM sqlite_sequence where name = '#{table_name}';")
- end
- end
- alias truncate_table delete_table
-
- def truncate_tables(tables)
- tables.each { |t| truncate_table(t) }
- end
-
- private
-
- # Returns a boolean indicating if the SQLite database is using the sqlite_sequence table.
- def uses_sequence
- select_value("SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';")
- end
- end
-
- module TruncateOrDelete
- def truncate_table(table_name)
- begin
- execute("TRUNCATE TABLE #{quote_table_name(table_name)};")
- rescue ::ActiveRecord::StatementInvalid
- execute("DELETE FROM #{quote_table_name(table_name)};")
- end
- end
- end
-
- module OracleAdapter
- def truncate_table(table_name)
- execute("TRUNCATE TABLE #{quote_table_name(table_name)}")
- end
- end
-
- module PostgreSQLAdapter
- def db_version
- @db_version ||= postgresql_version
- end
-
- def cascade
- @cascade ||= db_version >= 80200 ? 'CASCADE' : ''
- end
-
- def restart_identity
- @restart_identity ||= db_version >= 80400 ? 'RESTART IDENTITY' : ''
- end
-
- def truncate_table(table_name)
- truncate_tables([table_name])
- end
-
- def truncate_tables(table_names)
- return if table_names.nil? || table_names.empty?
- execute("TRUNCATE TABLE #{table_names.map{|name| quote_table_name(name)}.join(', ')} #{restart_identity} #{cascade};")
- end
-
- def pre_count_truncate_tables(tables, options = {:reset_ids => true})
- filter = options[:reset_ids] ? method(:has_been_used?) : method(:has_rows?)
- truncate_tables(tables.select(&filter))
- end
-
- def database_cleaner_table_cache
- # AR returns a list of tables without schema but then returns a
- # migrations table with the schema. There are other problems, too,
- # with using the base list. If a table exists in multiple schemas
- # within the search path, truncation without the schema name could
- # result in confusing, if not unexpected results.
- @database_cleaner_tables ||= tables_with_schema
- end
-
- private
-
- # Returns a boolean indicating if the given table has an auto-inc number higher than 0.
- # Note, this is different than an empty table since an table may populated, the index increased,
- # but then the table is cleaned. In other words, this function tells us if the given table
- # was ever inserted into.
- def has_been_used?(table)
- return has_rows?(table) unless has_sequence?(table)
-
- cur_val = select_value("SELECT currval('#{table}_id_seq');").to_i rescue 0
- cur_val > 0
- end
-
- def has_sequence?(table)
- select_value("SELECT true FROM pg_class WHERE relname = '#{table}_id_seq';")
- end
-
- def has_rows?(table)
- select_value("SELECT true FROM #{table} LIMIT 1;")
- end
-
- def tables_with_schema
- rows = select_rows <<-_SQL
- SELECT schemaname || '.' || tablename
- FROM pg_tables
- WHERE
- tablename !~ '_prt_' AND
- #{::DatabaseCleaner::ActiveRecord::Base.exclusion_condition('tablename')} AND
- schemaname = ANY (current_schemas(false))
- _SQL
- rows.collect { |result| result.first }
- end
- end
- end
-end
-
-module ActiveRecord
- module ConnectionAdapters
- #Apply adapter decoraters where applicable (adapter should be loaded)
- AbstractAdapter.class_eval { include DatabaseCleaner::ConnectionAdapters::AbstractAdapter }
-
- if defined?(JdbcAdapter)
- if defined?(OracleJdbcConnection)
- JdbcAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::OracleAdapter }
- else
- JdbcAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::TruncateOrDelete }
- end
- end
- AbstractMysqlAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::AbstractMysqlAdapter } if defined?(AbstractMysqlAdapter)
- Mysql2Adapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::AbstractMysqlAdapter } if defined?(Mysql2Adapter)
- MysqlAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::AbstractMysqlAdapter } if defined?(MysqlAdapter)
- SQLiteAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::SQLiteAdapter } if defined?(SQLiteAdapter)
- SQLite3Adapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::SQLiteAdapter } if defined?(SQLite3Adapter)
- PostgreSQLAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::PostgreSQLAdapter } if defined?(PostgreSQLAdapter)
- IBM_DBAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::IBM_DBAdapter } if defined?(IBM_DBAdapter)
- SQLServerAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::TruncateOrDelete } if defined?(SQLServerAdapter)
- OracleEnhancedAdapter.class_eval { include ::DatabaseCleaner::ConnectionAdapters::OracleAdapter } if defined?(OracleEnhancedAdapter)
- end
-end
-
-module DatabaseCleaner::ActiveRecord
- class Truncation
- include ::DatabaseCleaner::ActiveRecord::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def clean
- connection = connection_class.connection
- connection.disable_referential_integrity do
- if pre_count? && connection.respond_to?(:pre_count_truncate_tables)
- connection.pre_count_truncate_tables(tables_to_truncate(connection), {:reset_ids => reset_ids?})
- else
- connection.truncate_tables(tables_to_truncate(connection))
- end
- end
- end
-
- private
-
- def tables_to_truncate(connection)
- tables_in_db = cache_tables? ? connection.database_cleaner_table_cache : connection.database_tables
- to_reject = (@tables_to_exclude + connection.database_cleaner_view_cache)
- (@only || tables_in_db).reject do |table|
- if ( m = table.match(/([^.]+)$/) )
- to_reject.include?(m[1])
- else
- false
- end
- end
- end
-
- # overwritten
- def migration_storage_names
- result = [::DatabaseCleaner::ActiveRecord::Base.migration_table_name]
- result << ::ActiveRecord::Base.internal_metadata_table_name if ::ActiveRecord::VERSION::MAJOR >= 5
- result
- end
-
- def cache_tables?
- !!@cache_tables
- end
-
- def pre_count?
- @pre_count == true
- end
-
- def reset_ids?
- @reset_ids != false
- end
- end
-end
diff --git a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/version.rb b/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/version.rb
deleted file mode 100644
index 29fe3e1..0000000
--- a/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module ActiveRecord
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/base_spec.rb b/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/base_spec.rb
deleted file mode 100644
index 1024329..0000000
--- a/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/base_spec.rb
+++ /dev/null
@@ -1,170 +0,0 @@
-require 'active_record'
-require 'database_cleaner/active_record/base'
-require 'database_cleaner/spec'
-
-class FakeModel
- def self.connection
- :fake_connection
- end
-end
-
-RSpec.describe DatabaseCleaner::ActiveRecord do
- it { is_expected.to respond_to(:available_strategies) }
-
- it "has a default_strategy of transaction" do
- expect(described_class.default_strategy).to eq(:transaction)
- end
-
- describe "config_file_location" do
- after do
- # prevent global state leakage
- DatabaseCleaner::ActiveRecord.config_file_location=nil
- DatabaseCleaner.app_root = nil
- end
-
- it "should default to \#{DatabaseCleaner.app_root}/config/database.yml" do
- DatabaseCleaner::ActiveRecord.config_file_location = nil
- DatabaseCleaner.app_root = "/path/to"
- expect(DatabaseCleaner::ActiveRecord.config_file_location).to eq '/path/to/config/database.yml'
- end
- end
-end
-
-module DatabaseCleaner
- module ActiveRecord
- class ExampleStrategy
- include DatabaseCleaner::ActiveRecord::Base
- end
-
- RSpec.describe ExampleStrategy do
- let(:config_location) { '/path/to/config/database.yml' }
-
- around do |example|
- DatabaseCleaner::ActiveRecord.config_file_location = config_location
- example.run
- DatabaseCleaner::ActiveRecord.config_file_location = nil
- end
-
- it_should_behave_like "a generic strategy"
-
- describe "db" do
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
-
- describe "db=" do
- let(:config_location) { "spec/support/example.database.yml" }
-
- it "should process erb in the config" do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one" })
- end
-
- context 'when config file differs from established ActiveRecord configuration' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return({ "my_db" => { "database" => "two"} })
- end
-
- it 'uses the ActiveRecord configuration' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "two"})
- end
- end
-
- context 'when config file agrees with ActiveRecord configuration' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return({ "my_db" => { "database" => "one"} })
- end
-
- it 'uses the config file' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one"})
- end
- end
-
- context 'when ::ActiveRecord::Base.configurations nil' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return(nil)
- end
-
- it 'uses the config file' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one"})
- end
- end
-
- context 'when ::ActiveRecord::Base.configurations empty' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return({})
- end
-
- it 'uses the config file' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one"})
- end
- end
-
- context 'when config file is not available' do
- before do
- allow(File).to receive(:file?).with(config_location).and_return(false)
- end
-
- it "should skip config" do
- subject.db = :my_db
- expect(subject.connection_hash).not_to be
- end
- end
-
- it "skips the file when the model is set" do
- subject.db = FakeModel
- expect(subject.connection_hash).not_to be
- end
-
- it "skips the file when the db is set to :default" do
- # to avoid https://github.com/bmabey/database_cleaner/issues/72
- subject.db = :default
- expect(subject.connection_hash).not_to be
- end
- end
-
- describe "connection_class" do
- it "should default to ActiveRecord::Base" do
- expect(subject.connection_class).to eq ::ActiveRecord::Base
- end
-
- context "with database models" do
- context "connection_hash is set" do
- it "reuses the model's connection" do
- subject.connection_hash = {}
- subject.db = FakeModel
- expect(subject.connection_class).to eq FakeModel
- end
- end
-
- context "connection_hash is not set" do
- it "reuses the model's connection" do
- subject.db = FakeModel
- expect(subject.connection_class).to eq FakeModel
- end
- end
- end
-
- context "when connection_hash is set" do
- let(:hash) { {} }
- before { subject.connection_hash = hash }
-
- it "establishes a connection with it" do
- expect(::ActiveRecord::Base).to receive(:establish_connection).with(hash)
- expect(subject.connection_class).to eq ::ActiveRecord::Base
- end
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/transaction_spec.rb b/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/transaction_spec.rb
deleted file mode 100644
index c6fbdb1..0000000
--- a/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/transaction_spec.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-require 'database_cleaner/active_record/transaction'
-require 'active_record'
-
-module DatabaseCleaner
- module ActiveRecord
-
- RSpec.describe Transaction do
- let(:connection) { double("connection") }
- let(:connection_2) { double("connection_2") }
- let(:connection_pool) { double("connection_pool") }
-
- before do
- allow(::ActiveRecord::Base).to receive(:connection_pool).and_return(connection_pool)
- allow(connection_pool).to receive(:connections).and_return([connection])
- allow(::ActiveRecord::Base).to receive(:connection).and_return(connection)
- end
-
- describe "#start" do
- [:begin_transaction, :begin_db_transaction].each do |begin_transaction_method|
- context "using #{begin_transaction_method}" do
- before do
- allow(connection).to receive(:transaction)
- allow(connection).to receive(begin_transaction_method)
- end
-
- it "should increment open transactions if possible" do
- expect(connection).to receive(:increment_open_transactions)
- subject.start
- end
-
- it "should tell ActiveRecord to increment connection if its not possible to increment current connection" do
- expect(::ActiveRecord::Base).to receive(:increment_open_transactions)
- subject.start
- end
-
- it "should start a transaction" do
- allow(connection).to receive(:increment_open_transactions)
- expect(connection).to receive(begin_transaction_method)
- expect(connection).to receive(:transaction)
- subject.start
- end
- end
- end
- end
-
- describe "#clean" do
- context "manual accounting of transaction count" do
- it "should start a transaction" do
- expect(connection).to receive(:open_transactions).and_return(1)
-
- allow(connection).to receive(:decrement_open_transactions)
-
- expect(connection).to receive(:rollback_db_transaction)
- subject.clean
- end
-
- it "should decrement open transactions if possible" do
- expect(connection).to receive(:open_transactions).and_return(1)
-
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(connection).to receive(:decrement_open_transactions)
- subject.clean
- end
-
- it "should not try to decrement or rollback if open_transactions is 0 for whatever reason" do
- expect(connection).to receive(:open_transactions).and_return(0)
-
- subject.clean
- end
-
- it "should decrement connection via ActiveRecord::Base if connection won't" do
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(::ActiveRecord::Base).to receive(:decrement_open_transactions)
- subject.clean
- end
-
- it "should rollback open transactions in all connections" do
- allow(connection_pool).to receive(:connections).and_return([connection, connection_2])
-
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(connection_2).to receive(:open_transactions).and_return(1)
- allow(connection_2).to receive(:rollback_db_transaction)
-
- expect(::ActiveRecord::Base).to receive(:decrement_open_transactions).twice
- subject.clean
- end
-
- it "should rollback open transactions in all connections with an open transaction" do
- allow(connection_pool).to receive(:connections).and_return([connection, connection_2])
-
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(connection_2).to receive(:open_transactions).and_return(0)
-
- expect(::ActiveRecord::Base).to receive(:decrement_open_transactions).exactly(1).times
- subject.clean
- end
- end
-
- context "automatic accounting of transaction count (AR 4)" do
- before { stub_const("ActiveRecord::VERSION::MAJOR", 4) }
-
- it "should start a transaction" do
- allow(connection).to receive(:rollback_db_transaction)
- expect(connection).to receive(:open_transactions).and_return(1)
-
- expect(connection).not_to receive(:decrement_open_transactions)
- expect(connection).to receive(:rollback_transaction)
- subject.clean
- end
-
- it "should decrement open transactions if possible" do
- allow(connection).to receive(:rollback_transaction)
- expect(connection).to receive(:open_transactions).and_return(1)
-
- expect(connection).not_to receive(:decrement_open_transactions)
- subject.clean
- end
-
- it "should not try to decrement or rollback if open_transactions is 0 for whatever reason" do
- expect(connection).to receive(:open_transactions).and_return(0)
-
- subject.clean
- end
-
- it "should decrement connection via ActiveRecord::Base if connection won't" do
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_transaction)
-
- expect(::ActiveRecord::Base).not_to receive(:decrement_open_transactions)
- subject.clean
- end
- end
- end
-
- describe "#connection_maintains_transaction_count?" do
- it "should return true if the major active record version is < 4" do
- stub_const("ActiveRecord::VERSION::MAJOR", 3)
- expect(subject.connection_maintains_transaction_count?).to be_truthy
- end
-
- it "should return false if the major active record version is > 3" do
- stub_const("ActiveRecord::VERSION::MAJOR", 4)
- expect(subject.connection_maintains_transaction_count?).to be_falsey
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/truncation_spec.rb b/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/truncation_spec.rb
deleted file mode 100644
index fff56b5..0000000
--- a/adapters/database_cleaner-active_record/spec/database_cleaner/active_record/truncation_spec.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-require 'support/active_record_helper'
-require 'database_cleaner/active_record/truncation'
-
-RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
- ActiveRecordHelper.with_all_dbs do |helper|
- context "using a #{helper.db} connection" do
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- let(:connection) { helper.connection }
-
- before do
- allow(connection).to receive(:disable_referential_integrity).and_yield
- allow(connection).to receive(:database_cleaner_view_cache).and_return([])
- end
-
- describe '#clean' do
- context "with records" do
- before do
- 2.times { User.create! }
- 2.times { Agent.create! }
- end
-
- it "should truncate all tables" do
- expect { subject.clean }
- .to change { [User.count, Agent.count] }
- .from([2,2])
- .to([0,0])
- end
-
- it "should reset AUTO_INCREMENT index of table" do
- subject.clean
- expect(User.create.id).to eq 1
- end
-
- xit "should not reset AUTO_INCREMENT index of table if :reset_ids is false" do
- described_class.new(reset_ids: false).clean
- expect(User.create.id).to eq 3
- end
-
- it "should truncate all tables except for schema_migrations" do
- subject.clean
- count = connection.select_value("select count(*) from schema_migrations;").to_i
- expect(count).to eq 2
- end
-
- it "should only truncate the tables specified in the :only option when provided" do
- expect { described_class.new(only: ['agents']).clean }
- .to change { [User.count, Agent.count] }
- .from([2,2])
- .to([2,0])
- end
-
- it "should not truncate the tables specified in the :except option" do
- expect { described_class.new(except: ['users']).clean }
- .to change { [User.count, Agent.count] }
- .from([2,2])
- .to([2,0])
- end
-
- it "should raise an error when :only and :except options are used" do
- expect {
- described_class.new(except: ['widgets'], only: ['widgets'])
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when invalid options are provided" do
- expect { described_class.new(foo: 'bar') }.to raise_error(ArgumentError)
- end
-
- it "should not truncate views" do
- allow(connection).to receive(:database_cleaner_table_cache).and_return(%w[widgets dogs])
- allow(connection).to receive(:database_cleaner_view_cache).and_return(["widgets"])
-
- expect(connection).to receive(:truncate_tables).with(['dogs'])
-
- subject.clean
- end
- end
-
- describe "with pre_count optimization option" do
- subject { described_class.new(pre_count: true) }
-
- it "only truncates non-empty tables" do
- pending if helper.db == :sqlite3
- pending if helper.db == :postgres
-
- User.create!
-
- expect(connection).to receive(:truncate_tables).with(['users'])
- subject.clean
- end
- end
-
- context 'when :cache_tables is set to true' do
- it 'caches the list of tables to be truncated' do
- expect(connection).to receive(:database_cleaner_table_cache).and_return([])
- expect(connection).not_to receive(:tables)
-
- allow(connection).to receive(:truncate_tables)
- described_class.new(cache_tables: true).clean
- end
- end
-
- context 'when :cache_tables is set to false' do
- it 'does not cache the list of tables to be truncated' do
- expect(connection).not_to receive(:database_cleaner_table_cache)
- expect(connection).to receive(:tables).and_return([])
-
- allow(connection).to receive(:truncate_tables)
- described_class.new(cache_tables: false).clean
- end
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-active_record/spec/spec_helper.rb b/adapters/database_cleaner-active_record/spec/spec_helper.rb
deleted file mode 100644
index b58e50e..0000000
--- a/adapters/database_cleaner-active_record/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require 'database_cleaner'
-
-RSpec.configure do |config|
- # These two settings work together to allow you to limit a spec run
- # to individual examples or groups you care about by tagging them with
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
- # get run.
- config.filter_run :focus
- config.run_all_when_everything_filtered = true
-
- config.disable_monkey_patching!
-end
-
diff --git a/adapters/database_cleaner-active_record/spec/support/active_record_helper.rb b/adapters/database_cleaner-active_record/spec/support/active_record_helper.rb
deleted file mode 100644
index 5041e97..0000000
--- a/adapters/database_cleaner-active_record/spec/support/active_record_helper.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'active_record'
-require 'database_cleaner/spec/database_helper'
-
-class ActiveRecordHelper < DatabaseCleaner::Spec::DatabaseHelper
- def setup
- patch_mysql_adapters
-
- Kernel.const_set "User", Class.new(ActiveRecord::Base)
- Kernel.const_set "Agent", Class.new(ActiveRecord::Base)
-
- super
-
- connection.execute "CREATE TABLE IF NOT EXISTS schema_migrations (version VARCHAR(255));"
- connection.execute "INSERT INTO schema_migrations VALUES (1), (2);"
- end
-
- def teardown
- connection.execute "DROP TABLE schema_migrations;"
-
- super
-
- Kernel.send :remove_const, "User" if defined?(User)
- Kernel.send :remove_const, "Agent" if defined?(Agent)
- end
-
- private
-
- def establish_connection(config = default_config)
- ActiveRecord::Base.establish_connection(config)
- @connection = ActiveRecord::Base.connection
- end
-
- def patch_mysql_adapters
- # remove DEFAULT NULL from column definition, which is an error on primary keys in MySQL 5.7.3+
- primary_key_sql = "int(11) auto_increment PRIMARY KEY"
- ActiveRecord::ConnectionAdapters::MysqlAdapter::NATIVE_DATABASE_TYPES[:primary_key] = primary_key_sql
- ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:primary_key] = primary_key_sql
- end
-end
-
diff --git a/adapters/database_cleaner-active_record/spec/support/example.database.yml b/adapters/database_cleaner-active_record/spec/support/example.database.yml
deleted file mode 100644
index bddb4dc..0000000
--- a/adapters/database_cleaner-active_record/spec/support/example.database.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-my_db:
- database: <%= "ONE".downcase %>
-
diff --git a/adapters/database_cleaner-active_record/spec/support/sample.config.yml b/adapters/database_cleaner-active_record/spec/support/sample.config.yml
deleted file mode 100644
index 90132c0..0000000
--- a/adapters/database_cleaner-active_record/spec/support/sample.config.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-mysql:
- adapter: mysql
- database: database_cleaner_test
- username: root
- password:
- host: 127.0.0.1
- port: 3306
- encoding: utf8
-
-mysql2:
- adapter: mysql2
- database: database_cleaner_test
- username: root
- password:
- host: 127.0.0.1
- port: 3306
- encoding: utf8
-
-postgres:
- adapter: postgresql
- database: database_cleaner_test
- username: postgres
- password:
- host: 127.0.0.1
- encoding: unicode
- template: template0
-
-sqlite3:
- adapter: sqlite3
- database: tmp/database_cleaner_test.sqlite3
- pool: 5
- timeout: 5000
- encoding: utf8
-
diff --git a/adapters/database_cleaner-active_record/tmp/.keep b/adapters/database_cleaner-active_record/tmp/.keep
deleted file mode 100644
index e69de29..0000000
diff --git a/adapters/database_cleaner-couch_potato/.gitignore b/adapters/database_cleaner-couch_potato/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-couch_potato/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-couch_potato/.rspec b/adapters/database_cleaner-couch_potato/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-couch_potato/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-couch_potato/.travis.yml b/adapters/database_cleaner-couch_potato/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-couch_potato/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-couch_potato/Gemfile b/adapters/database_cleaner-couch_potato/Gemfile
deleted file mode 100644
index c426b92..0000000
--- a/adapters/database_cleaner-couch_potato/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-couch_potato.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-couch_potato/Gemfile.lock b/adapters/database_cleaner-couch_potato/Gemfile.lock
deleted file mode 100644
index 7ab3bb5..0000000
--- a/adapters/database_cleaner-couch_potato/Gemfile.lock
+++ /dev/null
@@ -1,80 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-couch_potato (1.8.0)
- couch_potato
- database_cleaner (~> 1.8.0)
-
-GEM
- remote: https://rubygems.org/
- specs:
- activemodel (5.2.4.1)
- activesupport (= 5.2.4.1)
- activesupport (5.2.4.1)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- concurrent-ruby (1.1.5)
- couch_potato (1.3.0)
- activemodel
- couchrest (~> 1.2.0)
- json (~> 1.6)
- couchrest (1.2.1)
- mime-types (>= 1.15)
- multi_json (~> 1.7, ~> 1.0)
- rest-client (~> 1.8.0)
- diff-lcs (1.3)
- domain_name (0.5.20180417)
- unf (>= 0.0.5, < 1.0.0)
- http-cookie (1.0.3)
- domain_name (~> 0.5)
- i18n (1.5.1)
- concurrent-ruby (~> 1.0)
- json (1.8.6)
- mime-types (2.99.3)
- minitest (5.14.0)
- multi_json (1.14.1)
- netrc (0.11.0)
- rake (10.4.2)
- rest-client (1.8.0)
- http-cookie (>= 1.0.2, < 2.0)
- mime-types (>= 1.16, < 3.0)
- netrc (~> 0.7)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- thread_safe (0.3.6)
- tzinfo (1.2.6)
- thread_safe (~> 0.1)
- unf (0.1.4)
- unf_ext
- unf_ext (0.0.7.5)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-couch_potato!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-couch_potato/LICENSE.txt b/adapters/database_cleaner-couch_potato/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-couch_potato/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-couch_potato/README.md b/adapters/database_cleaner-couch_potato/README.md
deleted file mode 100644
index a762625..0000000
--- a/adapters/database_cleaner-couch_potato/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Database Cleaner Adapter for CouchPotato
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-couch_potato.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-couch_potato)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-couch_potato/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-couch_potato)
-
-Clean your CouchPotato databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-couch_potato'
-end
-```
-
-## Supported Strategies
-
-Here is an overview of the supported strategies:
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Couch Potato |
- DatabaseCleaner[:couch_potato] |
- Multiple connections not yet supported |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-couch_potato/Rakefile b/adapters/database_cleaner-couch_potato/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-couch_potato/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-couch_potato/bin/console b/adapters/database_cleaner-couch_potato/bin/console
deleted file mode 100755
index 5f181ad..0000000
--- a/adapters/database_cleaner-couch_potato/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/couch_potato"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-couch_potato/bin/setup b/adapters/database_cleaner-couch_potato/bin/setup
deleted file mode 100755
index 3b72cbc..0000000
--- a/adapters/database_cleaner-couch_potato/bin/setup
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
diff --git a/adapters/database_cleaner-couch_potato/database_cleaner-couch_potato.gemspec b/adapters/database_cleaner-couch_potato/database_cleaner-couch_potato.gemspec
deleted file mode 100644
index 1b2f132..0000000
--- a/adapters/database_cleaner-couch_potato/database_cleaner-couch_potato.gemspec
+++ /dev/null
@@ -1,30 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/couch_potato/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-couch_potato"
- spec.version = DatabaseCleaner::CouchPotato::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using CouchPotato. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using CouchPotato. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-couch_potato"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "couch_potato"
-
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-couch_potato/lib/database_cleaner-couch_potato.rb b/adapters/database_cleaner-couch_potato/lib/database_cleaner-couch_potato.rb
deleted file mode 100644
index c407d56..0000000
--- a/adapters/database_cleaner-couch_potato/lib/database_cleaner-couch_potato.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/couch_potato"
diff --git a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato.rb b/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato.rb
deleted file mode 100644
index 21e6fa3..0000000
--- a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "database_cleaner/couch_potato/version"
-require "database_cleaner"
-require "database_cleaner/couch_potato/base"
-require "database_cleaner/couch_potato/truncation"
-
-module DatabaseCleaner::CouchPotato
- def self.default_strategy
- :truncation
- end
-end
-
diff --git a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/base.rb b/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/base.rb
deleted file mode 100644
index b53a52a..0000000
--- a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/base.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-module DatabaseCleaner
- module CouchPotato
- def self.available_strategies
- %w[truncation]
- end
- end
-end
diff --git a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb b/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
deleted file mode 100644
index 5a163aa..0000000
--- a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/truncation.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'database_cleaner/generic/truncation'
-
-module DatabaseCleaner
- module CouchPotato
- class Truncation
- include ::DatabaseCleaner::Generic::Truncation
-
- def initialize(options = {})
- if options.has_key?(:only) || options.has_key?(:except)
- raise ArgumentError, "The :only and :except options are not available for use with CouchPotato/CouchDB."
- elsif !options.empty?
- raise ArgumentError, "Unsupported option. You specified #{options.keys.join(',')}."
- end
- super
- end
-
- def clean
- database.recreate!
- end
-
- private
-
- def database
- ::CouchPotato.couchrest_database
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/version.rb b/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/version.rb
deleted file mode 100644
index 03a54d8..0000000
--- a/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module CouchPotato
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-couch_potato/spec/database_cleaner/couch_potato/base_spec.rb b/adapters/database_cleaner-couch_potato/spec/database_cleaner/couch_potato/base_spec.rb
deleted file mode 100644
index 734ebb8..0000000
--- a/adapters/database_cleaner-couch_potato/spec/database_cleaner/couch_potato/base_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'database_cleaner/couch_potato'
-
-RSpec.describe DatabaseCleaner::CouchPotato do
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
-end
-
diff --git a/adapters/database_cleaner-couch_potato/spec/database_cleaner/couch_potato/truncation_spec.rb b/adapters/database_cleaner-couch_potato/spec/database_cleaner/couch_potato/truncation_spec.rb
deleted file mode 100644
index 8f4360a..0000000
--- a/adapters/database_cleaner-couch_potato/spec/database_cleaner/couch_potato/truncation_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'database_cleaner/couch_potato/truncation'
-require 'couch_potato'
-
-module DatabaseCleaner
- module CouchPotato
-
- RSpec.describe Truncation do
- let(:database) { double('database') }
-
- before(:each) do
- allow(::CouchPotato).to receive(:couchrest_database).and_return(database)
- end
-
- it "should re-create the database" do
- expect(database).to receive(:recreate!)
-
- Truncation.new.clean
- end
-
- it "should raise an error when the :only option is used" do
- expect {
- Truncation.new(:only => ['document-type'])
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when the :except option is used" do
- expect {
- Truncation.new(:except => ['document-type'])
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when invalid options are provided" do
- expect {
- Truncation.new(:foo => 'bar')
- }.to raise_error(ArgumentError)
- end
- end
-
- end
-end
diff --git a/adapters/database_cleaner-couch_potato/spec/spec_helper.rb b/adapters/database_cleaner-couch_potato/spec/spec_helper.rb
deleted file mode 100644
index 1cd4ded..0000000
--- a/adapters/database_cleaner-couch_potato/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/couch_potato"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/.gitignore b/adapters/database_cleaner-data_mapper/.gitignore
deleted file mode 100644
index a2164d5..0000000
--- a/adapters/database_cleaner-data_mapper/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/spec/support/config.yml
-/tmp/
-!/tmp/.keep
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-data_mapper/.rspec b/adapters/database_cleaner-data_mapper/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-data_mapper/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-data_mapper/.travis.yml b/adapters/database_cleaner-data_mapper/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-data_mapper/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-data_mapper/Gemfile b/adapters/database_cleaner-data_mapper/Gemfile
deleted file mode 100644
index 10d5f58..0000000
--- a/adapters/database_cleaner-data_mapper/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-data_mapper.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-data_mapper/Gemfile.lock b/adapters/database_cleaner-data_mapper/Gemfile.lock
deleted file mode 100644
index fe492c9..0000000
--- a/adapters/database_cleaner-data_mapper/Gemfile.lock
+++ /dev/null
@@ -1,103 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-data_mapper (1.8.0)
- database_cleaner (~> 1.8.0)
- datamapper
- dm-transactions
-
-GEM
- remote: https://rubygems.org/
- specs:
- addressable (2.3.6)
- bcrypt (3.1.13)
- bcrypt-ruby (3.1.5)
- bcrypt (>= 3.1.3)
- data_objects (0.10.14)
- addressable (~> 2.1)
- datamapper (1.2.0)
- dm-aggregates (~> 1.2.0)
- dm-constraints (~> 1.2.0)
- dm-core (~> 1.2.0)
- dm-migrations (~> 1.2.0)
- dm-serializer (~> 1.2.0)
- dm-timestamps (~> 1.2.0)
- dm-transactions (~> 1.2.0)
- dm-types (~> 1.2.0)
- dm-validations (~> 1.2.0)
- diff-lcs (1.3)
- dm-aggregates (1.2.0)
- dm-core (~> 1.2.0)
- dm-constraints (1.2.0)
- dm-core (~> 1.2.0)
- dm-core (1.2.1)
- addressable (~> 2.3)
- dm-do-adapter (1.2.0)
- data_objects (~> 0.10.6)
- dm-core (~> 1.2.0)
- dm-migrations (1.2.0)
- dm-core (~> 1.2.0)
- dm-serializer (1.2.2)
- dm-core (~> 1.2.0)
- fastercsv (~> 1.5)
- json (~> 1.6)
- json_pure (~> 1.6)
- multi_json (~> 1.0)
- dm-sqlite-adapter (1.2.0)
- dm-do-adapter (~> 1.2.0)
- do_sqlite3 (~> 0.10.6)
- dm-timestamps (1.2.0)
- dm-core (~> 1.2.0)
- dm-transactions (1.2.0)
- dm-core (~> 1.2.0)
- dm-types (1.2.2)
- bcrypt-ruby (~> 3.0)
- dm-core (~> 1.2.0)
- fastercsv (~> 1.5)
- json (~> 1.6)
- multi_json (~> 1.0)
- stringex (~> 1.4)
- uuidtools (~> 2.1)
- dm-validations (1.2.0)
- dm-core (~> 1.2.0)
- do_sqlite3 (0.10.14)
- data_objects (= 0.10.14)
- fastercsv (1.5.5)
- json (1.8.6)
- json_pure (1.8.6)
- multi_json (1.14.1)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- stringex (1.5.1)
- uuidtools (2.1.5)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-data_mapper!
- dm-sqlite-adapter
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-data_mapper/LICENSE.txt b/adapters/database_cleaner-data_mapper/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-data_mapper/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-data_mapper/README.md b/adapters/database_cleaner-data_mapper/README.md
deleted file mode 100644
index fde8bc9..0000000
--- a/adapters/database_cleaner-data_mapper/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Database Cleaner Adapter for DataMapper
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-data_mapper.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-data_mapper)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-data_mapper/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-data_mapper)
-
-Clean your DataMapper databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-data_mapper'
-end
-```
-
-## Supported Strategies
-
-Here is an overview of the supported strategies:
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- Yes |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Data Mapper |
- DatabaseCleaner[:data_mapper] |
- Connection specified as :symbol keys, loaded via Datamapper repositories |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-data_mapper/Rakefile b/adapters/database_cleaner-data_mapper/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-data_mapper/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-data_mapper/bin/console b/adapters/database_cleaner-data_mapper/bin/console
deleted file mode 100755
index 66190aa..0000000
--- a/adapters/database_cleaner-data_mapper/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/data_mapper"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-data_mapper/bin/setup b/adapters/database_cleaner-data_mapper/bin/setup
deleted file mode 100755
index 268b1b4..0000000
--- a/adapters/database_cleaner-data_mapper/bin/setup
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-cp spec/support/sample.config.yml spec/support/config.yml
-
diff --git a/adapters/database_cleaner-data_mapper/database_cleaner-data_mapper.gemspec b/adapters/database_cleaner-data_mapper/database_cleaner-data_mapper.gemspec
deleted file mode 100644
index 39e24d2..0000000
--- a/adapters/database_cleaner-data_mapper/database_cleaner-data_mapper.gemspec
+++ /dev/null
@@ -1,34 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/data_mapper/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-data_mapper"
- spec.version = DatabaseCleaner::DataMapper::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using DataMapper. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using DataMapper. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-data_mapper"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "datamapper"
- spec.add_dependency "dm-transactions"
-
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rspec", "~> 3.0"
-
- spec.add_development_dependency "dm-sqlite-adapter"
- # spec.add_development_dependency "dm-migrations"
-end
diff --git a/adapters/database_cleaner-data_mapper/lib/database_cleaner-data_mapper.rb b/adapters/database_cleaner-data_mapper/lib/database_cleaner-data_mapper.rb
deleted file mode 100644
index 0be5186..0000000
--- a/adapters/database_cleaner-data_mapper/lib/database_cleaner-data_mapper.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/data_mapper"
diff --git a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper.rb b/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper.rb
deleted file mode 100644
index 26af40e..0000000
--- a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require "database_cleaner/data_mapper/version"
-require "database_cleaner"
-require "database_cleaner/data_mapper/transaction"
-require "database_cleaner/data_mapper/truncation"
diff --git a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/base.rb b/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/base.rb
deleted file mode 100644
index 29aa702..0000000
--- a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/base.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'database_cleaner/generic/base'
-module DatabaseCleaner
- module DataMapper
- def self.available_strategies
- %w[truncation transaction]
- end
-
- def self.default_strategy
- :transaction
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db ||= :default
- end
-
- end
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/transaction.rb b/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/transaction.rb
deleted file mode 100644
index 31b3287..0000000
--- a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/transaction.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'database_cleaner/data_mapper/base'
-require 'database_cleaner/generic/transaction'
-
-module DatabaseCleaner::DataMapper
- class Transaction
- include ::DatabaseCleaner::DataMapper::Base
- include ::DatabaseCleaner::Generic::Transaction
-
- def start(repository = self.db)
- ::DataMapper.repository(repository) do |r|
- transaction = DataMapper::Transaction.new(r)
- transaction.begin
- r.adapter.push_transaction(transaction)
- end
- end
-
- def clean(repository = self.db)
- ::DataMapper.repository(repository) do |r|
- adapter = r.adapter
- while adapter.current_transaction
- adapter.current_transaction.rollback
- adapter.pop_transaction
- end
- end
- end
-
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/truncation.rb b/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/truncation.rb
deleted file mode 100644
index f1dfe4b..0000000
--- a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/truncation.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-require "database_cleaner/generic/truncation"
-require 'database_cleaner/data_mapper/base'
-require 'data_mapper'
-
-module DataMapper
- module Adapters
-
- class DataObjectsAdapter
-
- def storage_names(repository = :default)
- raise NotImplementedError
- end
-
- def truncate_tables(table_names)
- table_names.each do |table_name|
- truncate_table table_name
- end
- end
-
- end
-
- class MysqlAdapter < DataObjectsAdapter
-
- # taken from https://github.com/godfat/dm-mapping/tree/master
- def storage_names(repository = :default)
- select 'SHOW TABLES'
- end
-
- def truncate_table(table_name)
- execute("TRUNCATE TABLE #{quote_name(table_name)};")
- end
-
- # copied from activerecord
- def disable_referential_integrity
- old = select("SELECT @@FOREIGN_KEY_CHECKS;")
- begin
- execute("SET FOREIGN_KEY_CHECKS = 0;")
- yield
- ensure
- execute("SET FOREIGN_KEY_CHECKS = ?", *old)
- end
- end
-
- end
-
- module SqliteAdapterMethods
-
- # taken from https://github.com/godfat/dm-mapping/tree/master
- def storage_names(repository = :default)
- # activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 177
- sql = <<-SQL
- SELECT name
- FROM sqlite_master
- WHERE type = 'table' AND NOT name = 'sqlite_sequence'
- SQL
- # activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 181
- select(sql)
- end
-
- def truncate_table(table_name)
- execute("DELETE FROM #{quote_name(table_name)};")
- if uses_sequence?
- execute("DELETE FROM sqlite_sequence where name = '#{table_name}';")
- end
- end
-
- # this is a no-op copied from activerecord
- # i didn't find out if/how this is possible
- # activerecord also doesn't do more here
- def disable_referential_integrity
- yield
- end
-
- private
-
- # Returns a boolean indicating if the SQLite database is using the sqlite_sequence table.
- def uses_sequence?
- sql = <<-SQL
- SELECT name FROM sqlite_master
- WHERE type='table' AND name='sqlite_sequence'
- SQL
- select(sql).first
- end
- end
-
- class SqliteAdapter; include SqliteAdapterMethods; end
- class Sqlite3Adapter; include SqliteAdapterMethods; end
-
- # FIXME
- # i don't know if this works
- # i basically just copied activerecord code to get a rough idea what they do.
- # i don't have postgres available, so i won't be the one to write this.
- # maybe codes below gets some postgres/datamapper user going, though.
- class PostgresAdapter < DataObjectsAdapter
-
- # taken from https://github.com/godfat/dm-mapping/tree/master
- def storage_names(repository = :default)
- sql = <<-SQL
- SELECT table_name FROM "information_schema"."tables"
- WHERE table_schema = current_schema() and table_type = 'BASE TABLE'
- SQL
- select(sql)
- end
-
- def truncate_table(table_name)
- execute("TRUNCATE TABLE #{quote_name(table_name)} RESTART IDENTITY CASCADE;")
- end
-
- # override to use a single statement
- def truncate_tables(table_names)
- quoted_names = table_names.collect { |n| quote_name(n) }.join(', ')
- execute("TRUNCATE TABLE #{quoted_names} RESTART IDENTITY;")
- end
-
- # FIXME
- # copied from activerecord
- def supports_disable_referential_integrity?
- version = select("SHOW server_version")[0][0].split('.')
- (version[0].to_i >= 8 && version[1].to_i >= 1) ? true : false
- rescue
- return false
- end
-
- # FIXME
- # copied unchanged from activerecord
- def disable_referential_integrity(repository = :default)
- if supports_disable_referential_integrity? then
- execute(storage_names(repository).collect do |name|
- "ALTER TABLE #{quote_name(name)} DISABLE TRIGGER ALL"
- end.join(";"))
- end
- yield
- ensure
- if supports_disable_referential_integrity? then
- execute(storage_names(repository).collect do |name|
- "ALTER TABLE #{quote_name(name)} ENABLE TRIGGER ALL"
- end.join(";"))
- end
- end
-
- end
-
- end
-end
-
-
-module DatabaseCleaner
- module DataMapper
- class Truncation
- include ::DatabaseCleaner::DataMapper::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def clean(repository = self.db)
- adapter = ::DataMapper.repository(repository).adapter
- adapter.disable_referential_integrity do
- adapter.truncate_tables(tables_to_truncate(repository))
- end
- end
-
- private
-
- def tables_to_truncate(repository = self.db)
- (@only || ::DataMapper.repository(repository).adapter.storage_names(repository)) - @tables_to_exclude
- end
-
- # overwritten
- def migration_storage_names
- %w[migration_info]
- end
-
- end
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/version.rb b/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/version.rb
deleted file mode 100644
index 222e161..0000000
--- a/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module DataMapper
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/base_spec.rb b/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/base_spec.rb
deleted file mode 100644
index 6ac4211..0000000
--- a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/base_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'database_cleaner/data_mapper/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe DataMapper do
- it { is_expected.to respond_to(:available_strategies) }
-
- it "has a default_strategy of transaction" do
- expect(described_class.default_strategy).to eq(:transaction)
- end
- end
-
- module DataMapper
- class ExampleStrategy
- include ::DatabaseCleaner::DataMapper::Base
- end
-
- RSpec.describe ExampleStrategy do
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/transaction_spec.rb b/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/transaction_spec.rb
deleted file mode 100644
index 61e0431..0000000
--- a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/transaction_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'database_cleaner/data_mapper/transaction'
-require 'database_cleaner/spec'
-#require 'data_mapper'
-
-module DatabaseCleaner
- module DataMapper
-
- RSpec.describe Transaction do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic transaction strategy"
-
- describe "start" do
- it "should start a transaction"
- end
-
- describe "clean" do
- it "should finish a transaction"
- end
- end
-
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb b/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb
deleted file mode 100644
index 49975ff..0000000
--- a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'database_cleaner/data_mapper/truncation'
-
-RSpec.describe DatabaseCleaner::DataMapper::Truncation do
- let(:helper) { DataMapperHelper.new(:sqlite3) }
-
- let(:connection) { helper.connection }
-
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- describe "DM connection adapter monkeypatches" do
- before { 2.times { User.create } }
-
- describe "#truncate_table" do
- it "truncates the table and resets AUTO_INCREMENT index of table" do
- connection.truncate_table(User.storage_names[:default])
- expect(User.count).to eq 0
- expect(User.create.id).to eq 1
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/truncation_spec.rb b/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/truncation_spec.rb
deleted file mode 100644
index b879b90..0000000
--- a/adapters/database_cleaner-data_mapper/spec/database_cleaner/data_mapper/truncation_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'database_cleaner/data_mapper/truncation'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- module DataMapper
- RSpec.describe Truncation do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic truncation strategy"
- end
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/spec/spec_helper.rb b/adapters/database_cleaner-data_mapper/spec/spec_helper.rb
deleted file mode 100644
index 4ea635d..0000000
--- a/adapters/database_cleaner-data_mapper/spec/spec_helper.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require "bundler/setup"
-require 'support/data_mapper_helper'
-require "database_cleaner/data_mapper"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-data_mapper/spec/support/data_mapper_helper.rb b/adapters/database_cleaner-data_mapper/spec/support/data_mapper_helper.rb
deleted file mode 100644
index 3734828..0000000
--- a/adapters/database_cleaner-data_mapper/spec/support/data_mapper_helper.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require 'database_cleaner/spec/database_helper'
-require "data_mapper"
-require "dm-sqlite-adapter"
-
-class DataMapperHelper < DatabaseCleaner::Spec::DatabaseHelper
- def setup
- super
-
- Kernel.const_set "User", Class.new
- User.instance_eval do
- include DataMapper::Resource
-
- storage_names[:default] = 'users'
-
- property :id, User::Serial
- property :name, String
- end
- end
-
- def teardown
- Kernel.send :remove_const, "User" if defined?(User)
-
- super
- end
-
- def connection
- DataMapper.repository.adapter
- end
-
- private
-
- def establish_connection(config = default_config)
- DataMapper.setup(:default, config)
- end
-end
-
diff --git a/adapters/database_cleaner-data_mapper/spec/support/sample.config.yml b/adapters/database_cleaner-data_mapper/spec/support/sample.config.yml
deleted file mode 100644
index 90132c0..0000000
--- a/adapters/database_cleaner-data_mapper/spec/support/sample.config.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-mysql:
- adapter: mysql
- database: database_cleaner_test
- username: root
- password:
- host: 127.0.0.1
- port: 3306
- encoding: utf8
-
-mysql2:
- adapter: mysql2
- database: database_cleaner_test
- username: root
- password:
- host: 127.0.0.1
- port: 3306
- encoding: utf8
-
-postgres:
- adapter: postgresql
- database: database_cleaner_test
- username: postgres
- password:
- host: 127.0.0.1
- encoding: unicode
- template: template0
-
-sqlite3:
- adapter: sqlite3
- database: tmp/database_cleaner_test.sqlite3
- pool: 5
- timeout: 5000
- encoding: utf8
-
diff --git a/adapters/database_cleaner-data_mapper/tmp/.keep b/adapters/database_cleaner-data_mapper/tmp/.keep
deleted file mode 100644
index e69de29..0000000
diff --git a/adapters/database_cleaner-mongo/.gitignore b/adapters/database_cleaner-mongo/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-mongo/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-mongo/.rspec b/adapters/database_cleaner-mongo/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-mongo/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-mongo/.travis.yml b/adapters/database_cleaner-mongo/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-mongo/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-mongo/Gemfile b/adapters/database_cleaner-mongo/Gemfile
deleted file mode 100644
index 8d40bd0..0000000
--- a/adapters/database_cleaner-mongo/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-mongo.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-mongo/Gemfile.lock b/adapters/database_cleaner-mongo/Gemfile.lock
deleted file mode 100644
index f542f87..0000000
--- a/adapters/database_cleaner-mongo/Gemfile.lock
+++ /dev/null
@@ -1,46 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-mongo (1.8.0)
- database_cleaner (~> 1.8.0)
- mongo
-
-GEM
- remote: https://rubygems.org/
- specs:
- bson (1.12.5)
- diff-lcs (1.3)
- mongo (1.12.5)
- bson (= 1.12.5)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-mongo!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-mongo/LICENSE.txt b/adapters/database_cleaner-mongo/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-mongo/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-mongo/README.md b/adapters/database_cleaner-mongo/README.md
deleted file mode 100644
index 2928f68..0000000
--- a/adapters/database_cleaner-mongo/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Database Cleaner Adapter for Mongo
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongo.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongo)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongo/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongo)
-
-Clean your Mongo databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-mongo'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Mongo |
- DatabaseCleaner[:mongo] |
- |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-mongo/Rakefile b/adapters/database_cleaner-mongo/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-mongo/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-mongo/bin/console b/adapters/database_cleaner-mongo/bin/console
deleted file mode 100755
index e35b53f..0000000
--- a/adapters/database_cleaner-mongo/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/mongo"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-mongo/bin/setup b/adapters/database_cleaner-mongo/bin/setup
deleted file mode 100755
index 3b72cbc..0000000
--- a/adapters/database_cleaner-mongo/bin/setup
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
diff --git a/adapters/database_cleaner-mongo/database_cleaner-mongo.gemspec b/adapters/database_cleaner-mongo/database_cleaner-mongo.gemspec
deleted file mode 100644
index a370c7b..0000000
--- a/adapters/database_cleaner-mongo/database_cleaner-mongo.gemspec
+++ /dev/null
@@ -1,30 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/mongo/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-mongo"
- spec.version = DatabaseCleaner::Mongo::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Mongo. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Mongo. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-mongo"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "mongo"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-mongo/lib/database_cleaner-mongo.rb b/adapters/database_cleaner-mongo/lib/database_cleaner-mongo.rb
deleted file mode 100644
index 3dde9b2..0000000
--- a/adapters/database_cleaner-mongo/lib/database_cleaner-mongo.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/mongo"
diff --git a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo.rb b/adapters/database_cleaner-mongo/lib/database_cleaner/mongo.rb
deleted file mode 100644
index da7c874..0000000
--- a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'database_cleaner/mongo/version'
-require 'database_cleaner'
-require 'database_cleaner/mongo/truncation'
-
-module DatabaseCleaner::Mongo
- def self.default_strategy
- :truncation
- end
-end
-
diff --git a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/base.rb b/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/base.rb
deleted file mode 100644
index 809a6e2..0000000
--- a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/base.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-module DatabaseCleaner
- module Mongo
- def self.available_strategies
- %w[truncation]
- end
- module Base
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db || raise("You have not specified a database. (see Mongo::Database)")
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/truncation.rb b/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/truncation.rb
deleted file mode 100644
index a09d1ff..0000000
--- a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/truncation.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'database_cleaner/mongo/base'
-require 'database_cleaner/generic/truncation'
-require 'database_cleaner/mongo/truncation_mixin'
-module DatabaseCleaner
- module Mongo
- class Truncation
- include ::DatabaseCleaner::Generic::Truncation
- include TruncationMixin
- include Base
- private
-
- def database
- db
- end
-
- def collections_cache
- @@collections_cache ||= {}
- end
-
- def mongoid_collection_names
- @@mongoid_collection_names ||= Hash.new{|h,k| h[k]=[]}.tap do |names|
- ObjectSpace.each_object(Class) do |klass|
- (names[klass.db.name] << klass.collection_name) if valid_collection_name?(klass)
- end
- end
- end
-
- def not_caching(db_name, list)
- @@not_caching ||= {}
-
- unless @@not_caching.has_key?(db_name)
- @@not_caching[db_name] = true
-
- puts "Not caching collection names for db #{db_name}. Missing these from models: #{list}"
- end
- end
-
- def collections
- return collections_cache[database.name] if collections_cache.has_key?(database.name)
- db_collections = database.collections.select { |c| c.name !~ /^system\./ }
-
- missing_collections = mongoid_collection_names[database.name] - db_collections.map(&:name)
-
- if missing_collections.empty?
- collections_cache[database.name] = db_collections
- else
- not_caching(database.name, missing_collections)
- end
-
- db_collections
- end
-
- private
-
- def valid_collection_name?(klass)
- klass.ancestors.map(&:to_s).include?('Mongoid::Document') &&
- !klass.embedded &&
- !klass.collection_name.empty?
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/truncation_mixin.rb b/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/truncation_mixin.rb
deleted file mode 100644
index 755b3df..0000000
--- a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/truncation_mixin.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module DatabaseCleaner
- module Mongo
- module TruncationMixin
-
- def clean
- if @only
- collections.each { |c| c.send(truncate_method_name) if @only.include?(c.name) }
- else
- collections.each { |c| c.send(truncate_method_name) unless @tables_to_exclude.include?(c.name) }
- end
- true
- end
-
- private
-
- def collections
- database.collections.select { |c| c.name !~ /^system\./ }
- end
-
- def truncate_method_name
- # This constant only exists in the 2.x series.
- defined?(::Mongo::VERSION) ? :delete_many : :remove
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/version.rb b/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/version.rb
deleted file mode 100644
index 3c7596e..0000000
--- a/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Mongo
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/base_spec.rb b/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/base_spec.rb
deleted file mode 100644
index 73d9d63..0000000
--- a/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/base_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'database_cleaner/mongo'
-
-RSpec.describe DatabaseCleaner::Mongo do
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
-end
-
diff --git a/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/mongo_examples.rb b/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/mongo_examples.rb
deleted file mode 100644
index 0360294..0000000
--- a/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/mongo_examples.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module MongoTest
- class Base
- def self.collection
- @connection ||= Mongo::Connection.new('127.0.0.1')
- @db ||= @connection.db('database_cleaner_specs')
- @collection ||= @db.collection(name) || @db.create_collection(name)
- end
-
- def self.count
- @collection.count
- end
-
- def initialize(attrs={})
- @attrs = attrs
- end
-
- def save!
- self.class.collection.insert(@attrs)
- end
- end
-
- class Widget < Base
- end
- class Gadget < Base
- end
-end
diff --git a/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/truncation_spec.rb b/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/truncation_spec.rb
deleted file mode 100644
index 9cf1dff..0000000
--- a/adapters/database_cleaner-mongo/spec/database_cleaner/mongo/truncation_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'mongo'
-require 'database_cleaner/mongo/truncation'
-require File.dirname(__FILE__) + '/mongo_examples'
-
-RSpec.describe DatabaseCleaner::Mongo::Truncation do
- around do |example|
- connection = Mongo::Connection.new('127.0.0.1')
- db_name = 'database_cleaner_specs'
- db = connection.db(db_name)
- subject.db = db
-
- example.run
-
- connection.drop_database(db_name)
- end
-
- before do
- MongoTest::Widget.new(name: 'some widget').save!
- MongoTest::Gadget.new(name: 'some gadget').save!
- end
-
- context "by default" do
- it "truncates all collections" do
- expect { subject.clean }.to change {
- [MongoTest::Widget.count, MongoTest::Gadget.count]
- }.from([1,1]).to([0,0])
- end
- end
-
- context "when collections are provided to the :only option" do
- subject { described_class.new(only: ['MongoTest::Widget']) }
-
- it "only truncates the specified collections" do
- expect { subject.clean }.to change {
- [MongoTest::Widget.count, MongoTest::Gadget.count]
- }.from([1,1]).to([0,1])
- end
- end
-
- context "when collections are provided to the :except option" do
- subject { described_class.new(except: ['MongoTest::Widget']) }
-
- it "truncates all but the specified collections" do
- expect { subject.clean }.to change {
- [MongoTest::Widget.count, MongoTest::Gadget.count]
- }.from([1,1]).to([1,0])
- end
- end
-end
-
diff --git a/adapters/database_cleaner-mongo/spec/spec_helper.rb b/adapters/database_cleaner-mongo/spec/spec_helper.rb
deleted file mode 100644
index 5797f97..0000000
--- a/adapters/database_cleaner-mongo/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/mongo"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-mongo_mapper/.gitignore b/adapters/database_cleaner-mongo_mapper/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-mongo_mapper/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-mongo_mapper/.rspec b/adapters/database_cleaner-mongo_mapper/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-mongo_mapper/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-mongo_mapper/.travis.yml b/adapters/database_cleaner-mongo_mapper/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-mongo_mapper/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-mongo_mapper/Gemfile b/adapters/database_cleaner-mongo_mapper/Gemfile
deleted file mode 100644
index dea1d87..0000000
--- a/adapters/database_cleaner-mongo_mapper/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-mongo_mapper.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-mongo_mapper/Gemfile.lock b/adapters/database_cleaner-mongo_mapper/Gemfile.lock
deleted file mode 100644
index 0eb287a..0000000
--- a/adapters/database_cleaner-mongo_mapper/Gemfile.lock
+++ /dev/null
@@ -1,59 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-mongo_mapper (1.8.1)
- database_cleaner (~> 1.8.0)
- mongo_mapper
-
-GEM
- remote: https://rubygems.org/
- specs:
- activemodel (3.0.20)
- activesupport (= 3.0.20)
- builder (~> 2.1.2)
- i18n (~> 0.5.0)
- activesupport (3.0.20)
- bson (1.12.5)
- builder (2.1.2)
- diff-lcs (1.3)
- i18n (0.5.4)
- mongo (1.12.5)
- bson (= 1.12.5)
- mongo_mapper (0.12.0)
- activemodel (~> 3.0)
- activesupport (~> 3.0)
- plucky (~> 0.5.2)
- plucky (0.5.2)
- mongo (~> 1.5)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-mongo_mapper!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-mongo_mapper/LICENSE.txt b/adapters/database_cleaner-mongo_mapper/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-mongo_mapper/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-mongo_mapper/README.md b/adapters/database_cleaner-mongo_mapper/README.md
deleted file mode 100644
index 768edc7..0000000
--- a/adapters/database_cleaner-mongo_mapper/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Database Cleaner Adapter for MongoMapper
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongo_mapper.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongo_mapper)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongo_mapper/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongo_mapper)
-
-Clean your MongoMapper databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-mongo_mapper'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Mongo Mapper |
- DatabaseCleaner[:mongo_mapper] |
- Multiple connections not yet supported |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-mongo_mapper/Rakefile b/adapters/database_cleaner-mongo_mapper/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-mongo_mapper/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-mongo_mapper/bin/console b/adapters/database_cleaner-mongo_mapper/bin/console
deleted file mode 100755
index 47256a7..0000000
--- a/adapters/database_cleaner-mongo_mapper/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/mongo_mapper"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-mongo_mapper/bin/setup b/adapters/database_cleaner-mongo_mapper/bin/setup
deleted file mode 100755
index 3fc3387..0000000
--- a/adapters/database_cleaner-mongo_mapper/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-
diff --git a/adapters/database_cleaner-mongo_mapper/database_cleaner-mongo_mapper.gemspec b/adapters/database_cleaner-mongo_mapper/database_cleaner-mongo_mapper.gemspec
deleted file mode 100644
index 9b64fa7..0000000
--- a/adapters/database_cleaner-mongo_mapper/database_cleaner-mongo_mapper.gemspec
+++ /dev/null
@@ -1,30 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/mongo_mapper/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-mongo_mapper"
- spec.version = DatabaseCleaner::MongoMapper::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using MongoMapper. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using MongoMapper. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-mongo_mapper"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "mongo_mapper"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner-mongo_mapper.rb b/adapters/database_cleaner-mongo_mapper/lib/database_cleaner-mongo_mapper.rb
deleted file mode 100644
index fd4856f..0000000
--- a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner-mongo_mapper.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/mongo_mapper"
diff --git a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper.rb b/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper.rb
deleted file mode 100644
index 17ee7f4..0000000
--- a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require "database_cleaner/mongo_mapper/version"
-require "database_cleaner"
-require "database_cleaner/mongo_mapper/truncation"
-
diff --git a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/base.rb b/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/base.rb
deleted file mode 100644
index 7cac7df..0000000
--- a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/base.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'database_cleaner/generic/base'
-module DatabaseCleaner
- module MongoMapper
- def self.available_strategies
- %w[truncation]
- end
-
- def self.default_strategy
- :truncation
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db ||= :default
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/truncation.rb b/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/truncation.rb
deleted file mode 100644
index b11a1e3..0000000
--- a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/truncation.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'database_cleaner/mongo_mapper/base'
-require 'database_cleaner/generic/truncation'
-
-module DatabaseCleaner
- module MongoMapper
- class Truncation
- include ::DatabaseCleaner::MongoMapper::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def clean
- if @only
- collections.each { |c| c.send(truncate_method_name) if @only.include?(c.name) }
- else
- collections.each { |c| c.send(truncate_method_name) unless @tables_to_exclude.include?(c.name) }
- end
- true
- end
-
- private
-
- def collections
- database.collections.select { |c| c.name !~ /^system\./ }
- end
-
- def truncate_method_name
- # This constant only exists in the 2.x series.
- defined?(::Mongo::VERSION) ? :delete_many : :remove
- end
-
- def database
- ::MongoMapper.database
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/version.rb b/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/version.rb
deleted file mode 100644
index 9ab43f3..0000000
--- a/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module MongoMapper
- VERSION = "1.8.1"
- end
-end
diff --git a/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/base_spec.rb b/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/base_spec.rb
deleted file mode 100644
index 6f6d395..0000000
--- a/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/base_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require 'database_cleaner/mongo_mapper/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe MongoMapper do
- it { is_expected.to respond_to(:available_strategies) }
-
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
- end
-
- module MongoMapper
- class ExampleStrategy
- include ::DatabaseCleaner::MongoMapper::Base
- end
-
- RSpec.describe ExampleStrategy do
-
- it_should_behave_like "a generic strategy"
-
- describe "db" do
- it { is_expected.to respond_to(:db=) }
-
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/mongo_examples.rb b/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/mongo_examples.rb
deleted file mode 100644
index f0b8a73..0000000
--- a/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/mongo_examples.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module MongoMapperTest
- class Widget
- include ::MongoMapper::Document
- key :name, String
- end
- class Gadget
- include ::MongoMapper::Document
- key :name, String
- end
-end
diff --git a/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/truncation_spec.rb b/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/truncation_spec.rb
deleted file mode 100644
index ce0a3f6..0000000
--- a/adapters/database_cleaner-mongo_mapper/spec/database_cleaner/mongo_mapper/truncation_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'mongo_mapper'
-require 'database_cleaner/mongo_mapper/truncation'
-require File.dirname(__FILE__) + '/mongo_examples'
-
-RSpec.describe DatabaseCleaner::MongoMapper::Truncation do
- around do |example|
- MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
- db_name = 'database_cleaner_specs'
- MongoMapper.database = db_name
-
- example.run
-
- MongoMapper.connection.drop_database(db_name)
- end
-
- before do
- MongoMapperTest::Widget.new(name: 'some widget').save!
- MongoMapperTest::Gadget.new(name: 'some gadget').save!
- end
-
- context "by default" do
- it "truncates all collections" do
- expect { subject.clean }.to change {
- [MongoMapperTest::Widget.count, MongoMapperTest::Gadget.count]
- }.from([1,1]).to([0,0])
- end
- end
-
- context "when collections are provided to the :only option" do
- subject { described_class.new(only: ['mongo_mapper_test.widgets']) }
-
- it "only truncates the specified collections" do
- expect { subject.clean }.to change {
- [MongoMapperTest::Widget.count, MongoMapperTest::Gadget.count]
- }.from([1,1]).to([0,1])
- end
- end
-
- context "when collections are provided to the :except option" do
- subject { described_class.new(except: ['mongo_mapper_test.widgets']) }
-
- it "truncates all but the specified collections" do
- expect { subject.clean }.to change {
- [MongoMapperTest::Widget.count, MongoMapperTest::Gadget.count]
- }.from([1,1]).to([1,0])
- end
- end
-end
-
diff --git a/adapters/database_cleaner-mongo_mapper/spec/spec_helper.rb b/adapters/database_cleaner-mongo_mapper/spec/spec_helper.rb
deleted file mode 100644
index 4c41088..0000000
--- a/adapters/database_cleaner-mongo_mapper/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/mongo_mapper"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-mongoid/.gitignore b/adapters/database_cleaner-mongoid/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-mongoid/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-mongoid/.rspec b/adapters/database_cleaner-mongoid/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-mongoid/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-mongoid/.travis.yml b/adapters/database_cleaner-mongoid/.travis.yml
deleted file mode 100644
index 251041f..0000000
--- a/adapters/database_cleaner-mongoid/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-mongoid/Gemfile b/adapters/database_cleaner-mongoid/Gemfile
deleted file mode 100644
index 0e454ce..0000000
--- a/adapters/database_cleaner-mongoid/Gemfile
+++ /dev/null
@@ -1,9 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-mongoid.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
-gem "database_cleaner-mongo", path: ".."
diff --git a/adapters/database_cleaner-mongoid/Gemfile.lock b/adapters/database_cleaner-mongoid/Gemfile.lock
deleted file mode 100644
index 088bfea..0000000
--- a/adapters/database_cleaner-mongoid/Gemfile.lock
+++ /dev/null
@@ -1,72 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: ..
- specs:
- database_cleaner-mongo (1.8.0)
- database_cleaner (~> 1.8.0)
- mongo
-
-PATH
- remote: .
- specs:
- database_cleaner-mongoid (1.8.1)
- database_cleaner (~> 1.8.0)
- database_cleaner-mongo (~> 1.8.0)
- mongoid
-
-GEM
- remote: https://rubygems.org/
- specs:
- activemodel (5.2.4.1)
- activesupport (= 5.2.4.1)
- activesupport (5.2.4.1)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- bson (4.5.0)
- concurrent-ruby (1.1.5)
- diff-lcs (1.3)
- i18n (1.5.1)
- concurrent-ruby (~> 1.0)
- minitest (5.14.0)
- mongo (2.10.2)
- bson (>= 4.4.2, < 5.0.0)
- mongoid (7.0.5)
- activemodel (>= 5.1, < 6.1)
- mongo (>= 2.5.1, < 3.0.0)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- thread_safe (0.3.6)
- tzinfo (1.2.6)
- thread_safe (~> 0.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-mongo!
- database_cleaner-mongoid!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-mongoid/LICENSE.txt b/adapters/database_cleaner-mongoid/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-mongoid/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-mongoid/README.md b/adapters/database_cleaner-mongoid/README.md
deleted file mode 100644
index 0937dfc..0000000
--- a/adapters/database_cleaner-mongoid/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Database Cleaner Adapter for Mongoid
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongoid.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongoid)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongoid/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongoid)
-
-Clean your Mongoid databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-mongoid'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Mongoid |
- DatabaseCleaner[:mongoid] |
- Multiple databases supported for Mongoid 3. Specify DatabaseCleaner[:mongoid, {:connection => :db_name}] |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-mongoid/Rakefile b/adapters/database_cleaner-mongoid/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-mongoid/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-mongoid/bin/console b/adapters/database_cleaner-mongoid/bin/console
deleted file mode 100755
index ac55de4..0000000
--- a/adapters/database_cleaner-mongoid/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/mongoid"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-mongoid/bin/setup b/adapters/database_cleaner-mongoid/bin/setup
deleted file mode 100755
index 3fc3387..0000000
--- a/adapters/database_cleaner-mongoid/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-
diff --git a/adapters/database_cleaner-mongoid/database_cleaner-mongoid.gemspec b/adapters/database_cleaner-mongoid/database_cleaner-mongoid.gemspec
deleted file mode 100644
index ea6ace3..0000000
--- a/adapters/database_cleaner-mongoid/database_cleaner-mongoid.gemspec
+++ /dev/null
@@ -1,31 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/mongoid/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-mongoid"
- spec.version = DatabaseCleaner::Mongoid::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Mongoid. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Mongoid. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-mongoid"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "database_cleaner-mongo", "~> 1.8.0"
- spec.add_dependency "mongoid"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner-mongoid.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner-mongoid.rb
deleted file mode 100644
index 536edc9..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner-mongoid.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/mongoid"
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid.rb
deleted file mode 100644
index bd58a7d..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "database_cleaner/mongoid/version"
-require "database_cleaner"
-require "database_cleaner/mongoid/truncation"
-
-module DatabaseCleaner::Mongoid
- def self.default_strategy
- :truncation
- end
-end
-
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/base.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/base.rb
deleted file mode 100644
index 417d466..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/base.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'database_cleaner/generic/base'
-module DatabaseCleaner
- module Mongoid
- def self.available_strategies
- %w[truncation]
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db || :default
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo1_truncation_mixin.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo1_truncation_mixin.rb
deleted file mode 100644
index fd29d9c..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo1_truncation_mixin.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module DatabaseCleaner
- module Mongoid
- module Mongo1TruncationMixin
- def clean
- if @only
- collections.each { |c| c.send(truncate_method_name) if @only.include?(c.name) }
- else
- collections.each { |c| c.send(truncate_method_name) unless @tables_to_exclude.include?(c.name) }
- end
- true
- end
-
- private
-
- def collections
- database.collections.select { |c| c.name !~ /^system\./ }
- end
-
- def truncate_method_name
- # This constant only exists in the 2.x series.
- defined?(::Mongo::VERSION) ? :delete_many : :remove
- end
- end
- end
-end
-
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo2_truncation_mixin.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo2_truncation_mixin.rb
deleted file mode 100644
index 459ed3d..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo2_truncation_mixin.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module DatabaseCleaner
- module Mongoid
- module Mongo2TruncationMixin
- def clean
- if @only
- collections.each { |c| database[c].find.delete_many if @only.include?(c) }
- else
- collections.each { |c| database[c].find.delete_many unless @tables_to_exclude.include?(c) }
- end
- true
- end
-
- private
-
- def database
- if @db.nil? || @db == :default
- ::Mongoid::Clients.default
- else
- ::Mongoid::Clients.with_name(@db)
- end
- end
-
- def collections
- if db != :default
- database.use(db)
- end
-
- database.collections.collect { |c| c.namespace.split('.',2)[1] }
-
- # database['system.namespaces'].find(:name => { '$not' => /\.system\.|\$/ }).to_a.map do |collection|
- # _, name = collection['name'].split('.', 2)
- # name
- # end
- end
- end
- end
-end
-
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongoid_truncation_mixin.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongoid_truncation_mixin.rb
deleted file mode 100644
index 3e1e164..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongoid_truncation_mixin.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'database_cleaner/generic/base'
-require 'database_cleaner/generic/truncation'
-
-module DatabaseCleaner
- module Mongoid
- module MongoidTruncationMixin
- include ::DatabaseCleaner::Generic::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db ||= :default
- end
-
- def host_port=(desired_host)
- @host = desired_host
- end
-
- def host
- @host ||= '127.0.0.1:27017'
- end
-
- def db_version
- @db_version ||= session.command('buildinfo' => 1)['version']
- end
-
- def clean
- if @only
- collections.each { |c| session[c].find.remove_all if @only.include?(c) }
- else
- collections.each { |c| session[c].find.remove_all unless @tables_to_exclude.include?(c) }
- end
- wait_for_removals_to_finish
- true
- end
-
- private
-
- def collections
- if db != :default
- session.use(db)
- end
-
- if db_version.split('.').first.to_i >= 3
- session.command(listCollections: 1, filter: { 'name' => { '$not' => /.?system\.|\$/ } })['cursor']['firstBatch'].map do |collection|
- collection['name']
- end
- else
- session['system.namespaces'].find(name: { '$not' => /\.system\.|\$/ }).to_a.map do |collection|
- _, name = collection['name'].split('.', 2)
- name
- end
- end
- end
-
- def wait_for_removals_to_finish
- session.command(getlasterror: 1)
- end
- end
- end
-end
-
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/truncation.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/truncation.rb
deleted file mode 100644
index 0131930..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/truncation.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'database_cleaner/mongoid/base'
-require 'database_cleaner/generic/truncation'
-require 'database_cleaner/mongoid/mongo1_truncation_mixin'
-require 'database_cleaner/mongoid/mongo2_truncation_mixin'
-require 'database_cleaner/mongoid/mongoid_truncation_mixin'
-require 'mongoid/version'
-
-module DatabaseCleaner
- module Mongoid
- class Truncation
- include ::DatabaseCleaner::Mongoid::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- if ::Mongoid::VERSION < '3'
-
- include ::DatabaseCleaner::Mongoid::Mongo1TruncationMixin
-
- private
-
- def database
- ::Mongoid.database
- end
-
- elsif ::Mongoid::VERSION < '5'
-
- include ::DatabaseCleaner::Mongoid::MongoidTruncationMixin
-
- private
-
- def session
- ::Mongoid::VERSION > "5.0.0" ? ::Mongoid.default_client : ::Mongoid.default_session
- end
-
- def database
- if not(@db.nil? or @db == :default)
- ::Mongoid.databases[@db]
- else
- ::Mongoid.database
- end
- end
-
- else
-
- include ::DatabaseCleaner::Mongoid::Mongo2TruncationMixin
-
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/version.rb b/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/version.rb
deleted file mode 100644
index ebf3722..0000000
--- a/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Mongoid
- VERSION = "1.8.1"
- end
-end
diff --git a/adapters/database_cleaner-mongoid/spec/database_cleaner/mongoid/base_spec.rb b/adapters/database_cleaner-mongoid/spec/database_cleaner/mongoid/base_spec.rb
deleted file mode 100644
index eab25b1..0000000
--- a/adapters/database_cleaner-mongoid/spec/database_cleaner/mongoid/base_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'database_cleaner/mongoid'
-
-RSpec.describe DatabaseCleaner::Mongoid do
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
-end
-
diff --git a/adapters/database_cleaner-mongoid/spec/spec_helper.rb b/adapters/database_cleaner-mongoid/spec/spec_helper.rb
deleted file mode 100644
index f582c40..0000000
--- a/adapters/database_cleaner-mongoid/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/mongoid"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-moped/.gitignore b/adapters/database_cleaner-moped/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-moped/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-moped/.rspec b/adapters/database_cleaner-moped/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-moped/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-moped/.travis.yml b/adapters/database_cleaner-moped/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-moped/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-moped/Gemfile b/adapters/database_cleaner-moped/Gemfile
deleted file mode 100644
index 18b6f2b..0000000
--- a/adapters/database_cleaner-moped/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-moped.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-moped/Gemfile.lock b/adapters/database_cleaner-moped/Gemfile.lock
deleted file mode 100644
index 49a5afa..0000000
--- a/adapters/database_cleaner-moped/Gemfile.lock
+++ /dev/null
@@ -1,50 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-moped (1.8.0)
- database_cleaner (~> 1.8.0)
- moped
-
-GEM
- remote: https://rubygems.org/
- specs:
- bson (3.2.7)
- connection_pool (2.2.2)
- diff-lcs (1.3)
- moped (2.0.7)
- bson (~> 3.0)
- connection_pool (~> 2.0)
- optionable (~> 0.2.0)
- optionable (0.2.0)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-moped!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-moped/LICENSE.txt b/adapters/database_cleaner-moped/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-moped/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-moped/README.md b/adapters/database_cleaner-moped/README.md
deleted file mode 100644
index a6fcdba..0000000
--- a/adapters/database_cleaner-moped/README.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Database Cleaner Adapter for Moped
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-moped.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-moped)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-moped/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-moped)
-
-Clean your Moped databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-moped'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Moped |
- DatabaseCleaner[:moped] |
- It is necessary to configure database name with DatabaseCleaner[:moped].db = db_name otherwise name `default` will be used. |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-moped/Rakefile b/adapters/database_cleaner-moped/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-moped/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-moped/bin/console b/adapters/database_cleaner-moped/bin/console
deleted file mode 100755
index 3b3f45f..0000000
--- a/adapters/database_cleaner-moped/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/moped"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-moped/bin/setup b/adapters/database_cleaner-moped/bin/setup
deleted file mode 100755
index 3fc3387..0000000
--- a/adapters/database_cleaner-moped/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-
diff --git a/adapters/database_cleaner-moped/database_cleaner-moped.gemspec b/adapters/database_cleaner-moped/database_cleaner-moped.gemspec
deleted file mode 100644
index bc0b628..0000000
--- a/adapters/database_cleaner-moped/database_cleaner-moped.gemspec
+++ /dev/null
@@ -1,30 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/moped/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-moped"
- spec.version = DatabaseCleaner::Moped::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Moped. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Moped. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-moped"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "moped"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-moped/lib/database_cleaner-moped.rb b/adapters/database_cleaner-moped/lib/database_cleaner-moped.rb
deleted file mode 100644
index a3190f2..0000000
--- a/adapters/database_cleaner-moped/lib/database_cleaner-moped.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/moped"
diff --git a/adapters/database_cleaner-moped/lib/database_cleaner/moped.rb b/adapters/database_cleaner-moped/lib/database_cleaner/moped.rb
deleted file mode 100644
index 6039ba7..0000000
--- a/adapters/database_cleaner-moped/lib/database_cleaner/moped.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "database_cleaner/moped/version"
-require "database_cleaner"
-require "database_cleaner/moped/truncation"
-
-module DatabaseCleaner::Moped
- def self.default_strategy
- :truncation
- end
-end
-
diff --git a/adapters/database_cleaner-moped/lib/database_cleaner/moped/base.rb b/adapters/database_cleaner-moped/lib/database_cleaner/moped/base.rb
deleted file mode 100644
index 51b7a26..0000000
--- a/adapters/database_cleaner-moped/lib/database_cleaner/moped/base.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'database_cleaner/generic/base'
-
-module DatabaseCleaner
- module Moped
- def self.available_strategies
- %w[truncation]
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db ||= :default
- end
-
- def host_port=(desired_host)
- @host = desired_host
- end
-
- def host
- @host ||= '127.0.0.1:27017'
- end
-
- def db_version
- @db_version ||= session.command('buildinfo' => 1)['version']
- end
-
- private
-
- def session
- @session ||= ::Moped::Session.new([host], database: db)
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-moped/lib/database_cleaner/moped/truncation.rb b/adapters/database_cleaner-moped/lib/database_cleaner/moped/truncation.rb
deleted file mode 100644
index 3be3349..0000000
--- a/adapters/database_cleaner-moped/lib/database_cleaner/moped/truncation.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'database_cleaner/moped/truncation_base'
-
-module DatabaseCleaner
- module Moped
- class Truncation
- include ::DatabaseCleaner::Moped::TruncationBase
- end
- end
-end
diff --git a/adapters/database_cleaner-moped/lib/database_cleaner/moped/truncation_base.rb b/adapters/database_cleaner-moped/lib/database_cleaner/moped/truncation_base.rb
deleted file mode 100644
index 06ce53c..0000000
--- a/adapters/database_cleaner-moped/lib/database_cleaner/moped/truncation_base.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'database_cleaner/moped/base'
-require 'database_cleaner/generic/truncation'
-
-module DatabaseCleaner
- module Moped
- module TruncationBase
- include ::DatabaseCleaner::Moped::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def clean
- if @only
- collections.each { |c| session[c].find.remove_all if @only.include?(c) }
- else
- collections.each { |c| session[c].find.remove_all unless @tables_to_exclude.include?(c) }
- end
- wait_for_removals_to_finish
- true
- end
-
- private
-
- def collections
- if db != :default
- session.use(db)
- end
-
- if db_version.split('.').first.to_i >= 3
- session.command(listCollections: 1, filter: { 'name' => { '$not' => /.?system\.|\$/ } })['cursor']['firstBatch'].map do |collection|
- collection['name']
- end
- else
- session['system.namespaces'].find(name: { '$not' => /\.system\.|\$/ }).to_a.map do |collection|
- _, name = collection['name'].split('.', 2)
- name
- end
- end
- end
-
- def wait_for_removals_to_finish
- session.command(getlasterror: 1)
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-moped/lib/database_cleaner/moped/version.rb b/adapters/database_cleaner-moped/lib/database_cleaner/moped/version.rb
deleted file mode 100644
index 63c4403..0000000
--- a/adapters/database_cleaner-moped/lib/database_cleaner/moped/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Moped
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-moped/spec/database_cleaner/moped/base_spec.rb b/adapters/database_cleaner-moped/spec/database_cleaner/moped/base_spec.rb
deleted file mode 100644
index 1594cdc..0000000
--- a/adapters/database_cleaner-moped/spec/database_cleaner/moped/base_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'database_cleaner/moped'
-
-RSpec.describe DatabaseCleaner::Moped do
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
-end
-
diff --git a/adapters/database_cleaner-moped/spec/database_cleaner/moped/moped_examples.rb b/adapters/database_cleaner-moped/spec/database_cleaner/moped/moped_examples.rb
deleted file mode 100644
index a144850..0000000
--- a/adapters/database_cleaner-moped/spec/database_cleaner/moped/moped_examples.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module MopedTest
- class Base
- def self.collection
- @db ||= 'database_cleaner_specs'
- @session ||= ::Moped::Session.new(['127.0.0.1:27017'], database: @db)
- @collection ||= @session[name]
- end
-
- def self.count
- @collection.find.count
- end
-
- def initialize(attrs={})
- @attrs = attrs
- end
-
- def save!
- self.class.collection.insert(@attrs)
- end
- end
-
- class Widget < Base
- end
- class Gadget < Base
- end
- class System < Base
- def self.collection
- super
- @collection = @session['system_logs']
- end
- end
-end
diff --git a/adapters/database_cleaner-moped/spec/database_cleaner/moped/truncation_spec.rb b/adapters/database_cleaner-moped/spec/database_cleaner/moped/truncation_spec.rb
deleted file mode 100644
index 758dcff..0000000
--- a/adapters/database_cleaner-moped/spec/database_cleaner/moped/truncation_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'moped'
-require 'database_cleaner/moped/truncation'
-require File.dirname(__FILE__) + '/moped_examples'
-
-RSpec.describe DatabaseCleaner::Moped::Truncation do
- around do |example|
- db_name = 'database_cleaner_specs'
- session = ::Moped::Session.new(['127.0.0.1:27017'], database: db_name)
- subject.db = db_name
-
- example.run
-
- session.drop
- session.command(getlasterror: 1)
- end
-
- before do
- MopedTest::Widget.new(name: 'some widget').save!
- MopedTest::Gadget.new(name: 'some gadget').save!
- MopedTest::System.new(name: 'some system').save!
- end
-
- context "by default" do
- it "truncates all collections" do
- expect { subject.clean }.to change {
- [MopedTest::Widget.count, MopedTest::Gadget.count, MopedTest::System.count]
- }.from([1,1,1]).to([0,0,0])
- end
- end
-
- context "when collections are provided to the :only option" do
- subject { described_class.new(only: ['MopedTest::Widget']) }
-
- it "only truncates the specified collections" do
- expect { subject.clean }.to change {
- [MopedTest::Widget.count, MopedTest::Gadget.count, MopedTest::System.count]
- }.from([1,1,1]).to([0,1,1])
- end
- end
-
- context "when collections are provided to the :except option" do
- subject { described_class.new(except: ['MopedTest::Widget']) }
-
- it "truncates all but the specified collections" do
- expect { subject.clean }.to change {
- [MopedTest::Widget.count, MopedTest::Gadget.count, MopedTest::System.count]
- }.from([1,1,1]).to([1,0,0])
- end
- end
-end
-
diff --git a/adapters/database_cleaner-moped/spec/spec_helper.rb b/adapters/database_cleaner-moped/spec/spec_helper.rb
deleted file mode 100644
index 00ccabe..0000000
--- a/adapters/database_cleaner-moped/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/moped"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-neo4j/.gitignore b/adapters/database_cleaner-neo4j/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-neo4j/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-neo4j/.rspec b/adapters/database_cleaner-neo4j/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-neo4j/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-neo4j/.travis.yml b/adapters/database_cleaner-neo4j/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-neo4j/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-neo4j/Gemfile b/adapters/database_cleaner-neo4j/Gemfile
deleted file mode 100644
index 75c909b..0000000
--- a/adapters/database_cleaner-neo4j/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-neo4j.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-neo4j/Gemfile.lock b/adapters/database_cleaner-neo4j/Gemfile.lock
deleted file mode 100644
index 2826709..0000000
--- a/adapters/database_cleaner-neo4j/Gemfile.lock
+++ /dev/null
@@ -1,81 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-neo4j (1.8.0)
- database_cleaner (~> 1.8.0)
- neo4j-core
-
-GEM
- remote: https://rubygems.org/
- specs:
- activesupport (5.2.4.1)
- concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- concurrent-ruby (1.1.5)
- diff-lcs (1.3)
- faraday (0.9.0)
- multipart-post (>= 1.2, < 3)
- faraday_middleware (0.9.1)
- faraday (>= 0.7.4, < 0.10)
- httparty (0.13.3)
- json (~> 1.8)
- multi_xml (>= 0.5.2)
- httpclient (2.5.3.3)
- i18n (1.5.1)
- concurrent-ruby (~> 1.0)
- json (1.8.6)
- minitest (5.14.0)
- multi_xml (0.5.5)
- multipart-post (2.0.0)
- neo4j-community (2.1.5)
- neo4j-core (3.0.8)
- activesupport
- faraday (~> 0.9.0)
- faraday_middleware (~> 0.9.1)
- httparty
- httpclient
- json
- neo4j-community (~> 2.1.1)
- net-http-persistent
- os
- zip
- net-http-persistent (2.9.4)
- os (0.9.6)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- thread_safe (0.3.6)
- tzinfo (1.2.6)
- thread_safe (~> 0.1)
- zip (2.0.2)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-neo4j!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-neo4j/LICENSE.txt b/adapters/database_cleaner-neo4j/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-neo4j/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-neo4j/README.md b/adapters/database_cleaner-neo4j/README.md
deleted file mode 100644
index eeb0eb0..0000000
--- a/adapters/database_cleaner-neo4j/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Database Cleaner Adapter for Neo4j
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-neo4j.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-neo4j)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-neo4j/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-neo4j)
-
-Clean your Neo4j databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-neo4j'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- Yes |
- Yes |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Neo4j |
- DatabaseCleaner[:neo4j] |
- Database type and path(URI) DatabaseCleaner[:neo4j, connection: {type: :server_db, path: 'http://localhost:7475'}]. |
-
-
-
-
-Note that Truncation and Deletion strategies for Neo4j will just delete all nodes and relationships from the database.
-
-## Common Errors
-
-### Model fails to load with Neo4j using transactions
-
-When you are using [neo4j](https://github.com/neo4jrb/neo4j) gem it creates schema and reads indexes upon loading models. These operations can't be done during a transaction. You have to preload your models before DatabaseCleaner starts a transaction.
-
-Add to your rails_helper or spec_helper after requiring database_cleaner-neo4j:
-
-```ruby
-require 'database_cleaner/neo4j'
-
-Dir["#{Rails.root}/app/models/**/*.rb"].each do |model|
- load model
-end
-```
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-neo4j/Rakefile b/adapters/database_cleaner-neo4j/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-neo4j/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-neo4j/bin/console b/adapters/database_cleaner-neo4j/bin/console
deleted file mode 100755
index 5cf2dcf..0000000
--- a/adapters/database_cleaner-neo4j/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/neo4j"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-neo4j/bin/setup b/adapters/database_cleaner-neo4j/bin/setup
deleted file mode 100755
index 3fc3387..0000000
--- a/adapters/database_cleaner-neo4j/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-
diff --git a/adapters/database_cleaner-neo4j/database_cleaner-neo4j.gemspec b/adapters/database_cleaner-neo4j/database_cleaner-neo4j.gemspec
deleted file mode 100644
index a39b652..0000000
--- a/adapters/database_cleaner-neo4j/database_cleaner-neo4j.gemspec
+++ /dev/null
@@ -1,30 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/neo4j/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-neo4j"
- spec.version = DatabaseCleaner::Neo4j::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Neo4j. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Neo4j. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-neo4j"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "neo4j-core"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner-neo4j.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner-neo4j.rb
deleted file mode 100644
index 8ea3f62..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner-neo4j.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/neo4j"
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j.rb
deleted file mode 100644
index ad87e33..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require "database_cleaner/neo4j/version"
-require "database_cleaner"
-require "database_cleaner/neo4j/transaction"
-require "database_cleaner/neo4j/truncation"
-require "database_cleaner/neo4j/deletion"
-
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/base.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/base.rb
deleted file mode 100644
index 727ae10..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/base.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require 'database_cleaner/generic/base'
-module DatabaseCleaner
- module Neo4j
- def self.available_strategies
- %w[transaction truncation deletion]
- end
-
- def self.default_strategy
- :transaction
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db == :default ? nil : desired_db
- end
-
- def db
- @db ||= nil
- end
-
- def start
- if db_type == :embedded_db and not session.running?
- session.start
- else
- session
- end
- end
-
- def database
- db && default_db.merge(db) || default_db
- end
-
- private
-
- def default_db
- {:type => default_db_type, :path => default_db_path}
- end
-
- def default_db_type
- :server_db
- end
-
- def default_db_path(type = default_db_type)
- type == :server_db ? 'http://localhost:7475/' : './db/test'
- end
-
- def db_type
- database[:type]
- end
-
- def db_path
- database[:path]
- end
-
- def db_params
- database.reject!{|key, value| [:type, :path].include? key }
- end
-
- def session
- @session ||= ::Neo4j::Session.open(db_type, db_path, db_params)
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/deletion.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/deletion.rb
deleted file mode 100644
index c6166ef..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/deletion.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'database_cleaner/neo4j/base'
-require 'neo4j-core'
-
-module DatabaseCleaner
- module Neo4j
- class Deletion
- include ::DatabaseCleaner::Neo4j::Base
-
- def clean
- ::Neo4j::Transaction.run do
- session._query('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r')
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
deleted file mode 100644
index b3e0dd9..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require 'database_cleaner/neo4j/base'
-require 'database_cleaner/generic/transaction'
-require 'neo4j-core'
-
-module DatabaseCleaner
- module Neo4j
- class Transaction
- include ::DatabaseCleaner::Generic::Transaction
- include ::DatabaseCleaner::Neo4j::Base
-
- attr_accessor :tx
-
- def start
- super
- rollback
- self.tx = ::Neo4j::Transaction.new
- end
-
- def clean
- rollback
- end
-
- private
-
- def rollback
- if tx
- tx.failure
- tx.close
- end
- ensure
- self.tx = nil
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/truncation.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/truncation.rb
deleted file mode 100644
index 6d92e1c..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/truncation.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'database_cleaner/neo4j/base'
-require 'database_cleaner/neo4j/deletion'
-
-module DatabaseCleaner
- module Neo4j
- class Truncation < DatabaseCleaner::Neo4j::Deletion
- end
- end
-end
diff --git a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/version.rb b/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/version.rb
deleted file mode 100644
index 0a43676..0000000
--- a/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Neo4j
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-neo4j/spec/database_cleaner/neo4j/base_spec.rb b/adapters/database_cleaner-neo4j/spec/database_cleaner/neo4j/base_spec.rb
deleted file mode 100644
index 467cd45..0000000
--- a/adapters/database_cleaner-neo4j/spec/database_cleaner/neo4j/base_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'database_cleaner/neo4j/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe Neo4j do
- it { is_expected.to respond_to(:available_strategies) }
-
- it "has a default_strategy of transaction" do
- expect(described_class.default_strategy).to eq(:transaction)
- end
- end
-
- module Neo4j
- class ExampleStrategy
- include ::DatabaseCleaner::Neo4j::Base
- end
-
- RSpec.describe ExampleStrategy do
-
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- it "should store my describe db" do
- db_conf = {:connection => {:type => :server_db, :path => 'http://localhost:7474'}}
- subject.db = db_conf
- expect(subject.db).to eq db_conf
- end
-
- it "should respect additional connection parameters" do
- db_conf = {:type => :server_db, :path => 'http://localhost:7474', basic_auth: {username: 'user', password: 'pass'}}
- subject.db = db_conf
- expect(stub_const("Neo4j::Session", double())).to receive(:open).with(:server_db, 'http://localhost:7474', {basic_auth: {username: 'user', password: 'pass'}}) { true }
- subject.start
- end
-
- it "should default to nil" do
- expect(subject.db).to be_nil
- end
-
- it "should return default configuration" do
- expect(subject.database).to eq(:type => :server_db, :path => 'http://localhost:7475/')
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-neo4j/spec/database_cleaner/neo4j/transaction_spec.rb b/adapters/database_cleaner-neo4j/spec/database_cleaner/neo4j/transaction_spec.rb
deleted file mode 100644
index 1a130a9..0000000
--- a/adapters/database_cleaner-neo4j/spec/database_cleaner/neo4j/transaction_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'neo4j-core'
-require 'database_cleaner/neo4j/transaction'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- module Neo4j
-
- RSpec.describe Transaction do
- before(:all) do
- DatabaseCleaner[:neo4j, :connection => {:type => :server_db, :path => 'http://localhost:7474'}]
- end
-
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic transaction strategy"
-
- describe "start" do
- it "should start a transaction"
- end
-
- describe "clean" do
- it "should finish a transaction"
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-neo4j/spec/spec_helper.rb b/adapters/database_cleaner-neo4j/spec/spec_helper.rb
deleted file mode 100644
index 59a87b7..0000000
--- a/adapters/database_cleaner-neo4j/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/neo4j"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-ohm/.gitignore b/adapters/database_cleaner-ohm/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-ohm/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-ohm/.rspec b/adapters/database_cleaner-ohm/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-ohm/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-ohm/.travis.yml b/adapters/database_cleaner-ohm/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-ohm/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-ohm/Gemfile b/adapters/database_cleaner-ohm/Gemfile
deleted file mode 100644
index 45f8ad4..0000000
--- a/adapters/database_cleaner-ohm/Gemfile
+++ /dev/null
@@ -1,9 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-ohm.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
-gem "database_cleaner-redis", path: ".."
diff --git a/adapters/database_cleaner-ohm/Gemfile.lock b/adapters/database_cleaner-ohm/Gemfile.lock
deleted file mode 100644
index afc19be..0000000
--- a/adapters/database_cleaner-ohm/Gemfile.lock
+++ /dev/null
@@ -1,64 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: ..
- specs:
- database_cleaner-redis (1.8.0)
- database_cleaner (~> 1.8.0)
- redis
-
-PATH
- remote: .
- specs:
- database_cleaner-ohm (1.8.1)
- database_cleaner (~> 1.8.0)
- database_cleaner-redis (~> 1.8.0)
- ohm
-
-GEM
- remote: https://rubygems.org/
- specs:
- diff-lcs (1.3)
- hiredis (0.6.3)
- nest (3.2.0)
- redic
- ohm (3.1.1)
- nest (~> 3)
- redic (~> 1.5.0)
- stal
- rake (10.4.2)
- redic (1.5.3)
- hiredis
- redis (4.1.1)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- stal (0.3.0)
- redic (~> 1.5)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-ohm!
- database_cleaner-redis!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-ohm/LICENSE.txt b/adapters/database_cleaner-ohm/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-ohm/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-ohm/README.md b/adapters/database_cleaner-ohm/README.md
deleted file mode 100644
index 3a832a0..0000000
--- a/adapters/database_cleaner-ohm/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Database Cleaner Adapter for Ohm
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-ohm.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-ohm)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-ohm/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-ohm)
-
-Clean your Ohm databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-ohm'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-`:only` and `:except` take a list of strings to be passed to [`keys`](https://redis.io/commands/keys)).
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Ohm |
- DatabaseCleaner[:ohm] |
- Connection specified as Redis URI |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-ohm/Rakefile b/adapters/database_cleaner-ohm/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-ohm/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-ohm/bin/console b/adapters/database_cleaner-ohm/bin/console
deleted file mode 100755
index fc6cccb..0000000
--- a/adapters/database_cleaner-ohm/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/ohm"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-ohm/bin/setup b/adapters/database_cleaner-ohm/bin/setup
deleted file mode 100755
index 3fc3387..0000000
--- a/adapters/database_cleaner-ohm/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-
diff --git a/adapters/database_cleaner-ohm/database_cleaner-ohm.gemspec b/adapters/database_cleaner-ohm/database_cleaner-ohm.gemspec
deleted file mode 100644
index ad32c72..0000000
--- a/adapters/database_cleaner-ohm/database_cleaner-ohm.gemspec
+++ /dev/null
@@ -1,31 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/ohm/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-ohm"
- spec.version = DatabaseCleaner::Ohm::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Ohm. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Ohm. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-ohm"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "database_cleaner-redis", "~> 1.8.0"
- spec.add_dependency "ohm"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-ohm/lib/database_cleaner-ohm.rb b/adapters/database_cleaner-ohm/lib/database_cleaner-ohm.rb
deleted file mode 100644
index 59abca2..0000000
--- a/adapters/database_cleaner-ohm/lib/database_cleaner-ohm.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/ohm"
diff --git a/adapters/database_cleaner-ohm/lib/database_cleaner/ohm.rb b/adapters/database_cleaner-ohm/lib/database_cleaner/ohm.rb
deleted file mode 100644
index 4ad0600..0000000
--- a/adapters/database_cleaner-ohm/lib/database_cleaner/ohm.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "database_cleaner/ohm/version"
-require "database_cleaner"
-require "database_cleaner/ohm/truncation"
-
-DatabaseCleaner.deprecate "The Ohm adapter for DatabaseCleaner is deprecated, and will be removed in v2.0. Please use the Redis adapter instead."
-
-module DatabaseCleaner::Ohm
- def self.default_strategy
- :truncation
- end
-end
-
diff --git a/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/truncation.rb b/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/truncation.rb
deleted file mode 100644
index 792e94a..0000000
--- a/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/truncation.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-begin # when database_cleaner-ohm is loaded as a gem
- require 'database_cleaner/redis/truncation'
-rescue LoadError # when database_cleaner is loaded as a gem
- $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/../../../../../adapters/database_cleaner-redis/lib")
- require 'database_cleaner/redis/truncation'
-end
-
-module DatabaseCleaner
- module Ohm
- def self.available_strategies
- %w(truncation)
- end
-
- class Truncation < ::DatabaseCleaner::Redis::Truncation
-
- private
-
- def default_redis
- ::Ohm.redis
- end
-
- end
- end
-end
diff --git a/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/version.rb b/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/version.rb
deleted file mode 100644
index 7bb9c72..0000000
--- a/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Ohm
- VERSION = "1.8.1"
- end
-end
diff --git a/adapters/database_cleaner-ohm/spec/database_cleaner/ohm/base_spec.rb b/adapters/database_cleaner-ohm/spec/database_cleaner/ohm/base_spec.rb
deleted file mode 100644
index 0662e81..0000000
--- a/adapters/database_cleaner-ohm/spec/database_cleaner/ohm/base_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require 'database_cleaner/ohm'
-
-RSpec.describe DatabaseCleaner::Ohm do
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
-end
-
diff --git a/adapters/database_cleaner-ohm/spec/database_cleaner/ohm/truncation_spec.rb b/adapters/database_cleaner-ohm/spec/database_cleaner/ohm/truncation_spec.rb
deleted file mode 100644
index a09f7f6..0000000
--- a/adapters/database_cleaner-ohm/spec/database_cleaner/ohm/truncation_spec.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'ohm'
-require 'database_cleaner/ohm/truncation'
-require 'yaml'
-
-module OhmTests
- class Widget < ::Ohm::Model
- attribute :name
- end
-
- class Gadget < ::Ohm::Model
- attribute :name
- end
-end
-
-RSpec.describe DatabaseCleaner::Ohm::Truncation do
- around do |example|
- config = YAML::load(File.open("spec/support/redis.yml"))
- Ohm.connect url: config['test']['url']
- @redis = Ohm.redis
-
- example.run
-
- @redis.flushdb
- end
-
- before do
- OhmTests::Widget.new(name: 'some widget').save
- OhmTests::Gadget.new(name: 'some gadget').save
- end
-
- context "by default" do
- it "truncates all keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(6).to(0)
- end
- end
-
- context "when keys are provided to the :only option" do
- subject { described_class.new(only: ['*Widget*']) }
-
- it "only truncates the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(6).to(3)
- expect(@redis.get('OhmTests::Gadget:id')).to eq '1'
- end
- end
-
- context "when keys are provided to the :except option" do
- subject { described_class.new(except: ['*Widget*']) }
-
- it "truncates all but the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(6).to(3)
- expect(@redis.get('OhmTests::Widget:id')).to eq '1'
- end
- end
-end
-
diff --git a/adapters/database_cleaner-ohm/spec/spec_helper.rb b/adapters/database_cleaner-ohm/spec/spec_helper.rb
deleted file mode 100644
index d5af979..0000000
--- a/adapters/database_cleaner-ohm/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/ohm"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-ohm/spec/support/redis.yml b/adapters/database_cleaner-ohm/spec/support/redis.yml
deleted file mode 100644
index a3b6cba..0000000
--- a/adapters/database_cleaner-ohm/spec/support/redis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-test:
- url: 'redis://localhost:6379/0'
-
-one:
- url: 'redis://localhost:6379/1'
-
-two:
- url: 'redis://localhost:6379/2'
diff --git a/adapters/database_cleaner-redis/.gitignore b/adapters/database_cleaner-redis/.gitignore
deleted file mode 100644
index b04a8c8..0000000
--- a/adapters/database_cleaner-redis/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/tmp/
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-redis/.rspec b/adapters/database_cleaner-redis/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-redis/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-redis/.travis.yml b/adapters/database_cleaner-redis/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-redis/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-redis/Gemfile b/adapters/database_cleaner-redis/Gemfile
deleted file mode 100644
index 6520bbc..0000000
--- a/adapters/database_cleaner-redis/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-redis.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-redis/Gemfile.lock b/adapters/database_cleaner-redis/Gemfile.lock
deleted file mode 100644
index 2e223d4..0000000
--- a/adapters/database_cleaner-redis/Gemfile.lock
+++ /dev/null
@@ -1,44 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-redis (1.8.0)
- database_cleaner (~> 1.8.0)
- redis
-
-GEM
- remote: https://rubygems.org/
- specs:
- diff-lcs (1.3)
- rake (10.4.2)
- redis (4.1.1)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-redis!
- rake (~> 10.0)
- rspec (~> 3.0)
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-redis/LICENSE.txt b/adapters/database_cleaner-redis/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-redis/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-redis/README.md b/adapters/database_cleaner-redis/README.md
deleted file mode 100644
index 742d2a2..0000000
--- a/adapters/database_cleaner-redis/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Database Cleaner Adapter for Redis
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-redis.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-redis)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-redis/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-redis)
-
-Clean your Redis databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-redis'
-end
-```
-
-## Supported Strategies
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- No |
- No |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-`:only` and `:except` take a list of strings to be passed to [`keys`](https://redis.io/commands/keys)).
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Redis |
- DatabaseCleaner[:redis] |
- Connection specified as Redis URI |
-
-
-
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-redis/Rakefile b/adapters/database_cleaner-redis/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-redis/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-redis/bin/console b/adapters/database_cleaner-redis/bin/console
deleted file mode 100755
index 9f71d2b..0000000
--- a/adapters/database_cleaner-redis/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/redis"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-redis/bin/setup b/adapters/database_cleaner-redis/bin/setup
deleted file mode 100755
index 3fc3387..0000000
--- a/adapters/database_cleaner-redis/bin/setup
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-
diff --git a/adapters/database_cleaner-redis/database_cleaner-redis.gemspec b/adapters/database_cleaner-redis/database_cleaner-redis.gemspec
deleted file mode 100644
index 3afd8e4..0000000
--- a/adapters/database_cleaner-redis/database_cleaner-redis.gemspec
+++ /dev/null
@@ -1,30 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/redis/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-redis"
- spec.version = DatabaseCleaner::Redis::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Redis. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Redis. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-redis"
- spec.license = "MIT"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "redis"
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-end
diff --git a/adapters/database_cleaner-redis/lib/database_cleaner-redis.rb b/adapters/database_cleaner-redis/lib/database_cleaner-redis.rb
deleted file mode 100644
index 63b1d4a..0000000
--- a/adapters/database_cleaner-redis/lib/database_cleaner-redis.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/redis"
diff --git a/adapters/database_cleaner-redis/lib/database_cleaner/redis.rb b/adapters/database_cleaner-redis/lib/database_cleaner/redis.rb
deleted file mode 100644
index de1c042..0000000
--- a/adapters/database_cleaner-redis/lib/database_cleaner/redis.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require "database_cleaner/redis/version"
-require "database_cleaner"
-require "database_cleaner/redis/truncation"
-
diff --git a/adapters/database_cleaner-redis/lib/database_cleaner/redis/base.rb b/adapters/database_cleaner-redis/lib/database_cleaner/redis/base.rb
deleted file mode 100644
index 1d90479..0000000
--- a/adapters/database_cleaner-redis/lib/database_cleaner/redis/base.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'database_cleaner/generic/base'
-
-module DatabaseCleaner
- module Redis
- def self.available_strategies
- %w{truncation}
- end
-
- def self.default_strategy
- :truncation
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- @db ||= :default
- end
-
- alias url db
-
- private
-
- def connection
- @connection ||= begin
- if url == :default
- ::Redis.new
- elsif db.is_a?(::Redis) # pass directly the connection
- db
- else
- ::Redis.new(:url => url)
- end
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-redis/lib/database_cleaner/redis/truncation.rb b/adapters/database_cleaner-redis/lib/database_cleaner/redis/truncation.rb
deleted file mode 100644
index 32badcc..0000000
--- a/adapters/database_cleaner-redis/lib/database_cleaner/redis/truncation.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'database_cleaner/redis/base'
-require 'database_cleaner/generic/truncation'
-
-module DatabaseCleaner
- module Redis
- class Truncation
- include ::DatabaseCleaner::Redis::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def clean
- if @only
- @only.each do |term|
- connection.keys(term).each { |k| connection.del k }
- end
- elsif @tables_to_exclude
- keys_except = []
- @tables_to_exclude.each { |term| keys_except += connection.keys(term) }
- connection.keys.each { |k| connection.del(k) unless keys_except.include?(k) }
- else
- connection.flushdb
- end
- connection.quit unless url == :default
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-redis/lib/database_cleaner/redis/version.rb b/adapters/database_cleaner-redis/lib/database_cleaner/redis/version.rb
deleted file mode 100644
index acfd5f8..0000000
--- a/adapters/database_cleaner-redis/lib/database_cleaner/redis/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Redis
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-redis/spec/database_cleaner/redis/base_spec.rb b/adapters/database_cleaner-redis/spec/database_cleaner/redis/base_spec.rb
deleted file mode 100644
index c1ecb9c..0000000
--- a/adapters/database_cleaner-redis/spec/database_cleaner/redis/base_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'redis'
-require 'database_cleaner/redis/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe Redis do
- it { is_expected.to respond_to(:available_strategies) }
-
- it "has a default_strategy of truncation" do
- expect(described_class.default_strategy).to eq(:truncation)
- end
- end
-
- module Redis
- class ExampleStrategy
- include ::DatabaseCleaner::Redis::Base
- end
-
- RSpec.describe ExampleStrategy do
-
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- context "when passing url" do
- it "should store my describe db" do
- url = 'redis://localhost:6379/2'
- subject.db = 'redis://localhost:6379/2'
- expect(subject.db).to eq url
- end
- end
-
- context "when passing connection" do
- it "should store my describe db" do
- connection = ::Redis.new :url => 'redis://localhost:6379/2'
- subject.db = connection
- expect(subject.db).to eq connection
- end
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-redis/spec/database_cleaner/redis/truncation_spec.rb b/adapters/database_cleaner-redis/spec/database_cleaner/redis/truncation_spec.rb
deleted file mode 100644
index e3960c8..0000000
--- a/adapters/database_cleaner-redis/spec/database_cleaner/redis/truncation_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'redis'
-require 'database_cleaner/redis/truncation'
-require 'yaml'
-
-RSpec.describe DatabaseCleaner::Redis::Truncation do
- around do |example|
- config = YAML::load(File.open("spec/support/redis.yml"))
- @redis = ::Redis.new :url => config['test']['url']
-
- example.run
-
- @redis.flushdb
- end
-
- before do
- @redis.set 'Widget', 1
- @redis.set 'Gadget', 1
- end
-
- context "by default" do
- it "truncates all keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(2).to(0)
- end
- end
-
- context "when keys are provided to the :only option" do
- subject { described_class.new(only: ['Widge*']) }
-
- it "only truncates the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(2).to(1)
- expect(@redis.get('Gadget')).to eq '1'
- end
- end
-
- context "when keys are provided to the :except option" do
- subject { described_class.new(except: ['Widg*']) }
-
- it "truncates all but the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(2).to(1)
- expect(@redis.get('Widget')).to eq '1'
- end
- end
-end
-
diff --git a/adapters/database_cleaner-redis/spec/spec_helper.rb b/adapters/database_cleaner-redis/spec/spec_helper.rb
deleted file mode 100644
index 6ac3571..0000000
--- a/adapters/database_cleaner-redis/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/redis"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-redis/spec/support/redis.yml b/adapters/database_cleaner-redis/spec/support/redis.yml
deleted file mode 100644
index a3b6cba..0000000
--- a/adapters/database_cleaner-redis/spec/support/redis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-test:
- url: 'redis://localhost:6379/0'
-
-one:
- url: 'redis://localhost:6379/1'
-
-two:
- url: 'redis://localhost:6379/2'
diff --git a/adapters/database_cleaner-sequel/.gitignore b/adapters/database_cleaner-sequel/.gitignore
deleted file mode 100644
index a2164d5..0000000
--- a/adapters/database_cleaner-sequel/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/.bundle/
-/.yardoc
-/_yardoc/
-/coverage/
-/doc/
-/pkg/
-/spec/reports/
-/spec/support/config.yml
-/tmp/
-!/tmp/.keep
-
-# rspec failure tracking
-.rspec_status
diff --git a/adapters/database_cleaner-sequel/.rspec b/adapters/database_cleaner-sequel/.rspec
deleted file mode 100644
index 34c5164..0000000
--- a/adapters/database_cleaner-sequel/.rspec
+++ /dev/null
@@ -1,3 +0,0 @@
---format documentation
---color
---require spec_helper
diff --git a/adapters/database_cleaner-sequel/.travis.yml b/adapters/database_cleaner-sequel/.travis.yml
deleted file mode 100644
index 9912d68..0000000
--- a/adapters/database_cleaner-sequel/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: ruby
-rvm:
- - 2.2.9
-before_install: gem install bundler -v 1.17.2
diff --git a/adapters/database_cleaner-sequel/Gemfile b/adapters/database_cleaner-sequel/Gemfile
deleted file mode 100644
index c9ca10d..0000000
--- a/adapters/database_cleaner-sequel/Gemfile
+++ /dev/null
@@ -1,8 +0,0 @@
-source "https://rubygems.org"
-
-git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
-
-# Specify your gem's dependencies in database_cleaner-sequel.gemspec
-gemspec
-
-gem "database_cleaner", path: "../.."
diff --git a/adapters/database_cleaner-sequel/Gemfile.lock b/adapters/database_cleaner-sequel/Gemfile.lock
deleted file mode 100644
index fd2f4fa..0000000
--- a/adapters/database_cleaner-sequel/Gemfile.lock
+++ /dev/null
@@ -1,52 +0,0 @@
-PATH
- remote: ../..
- specs:
- database_cleaner (1.8.2)
-
-PATH
- remote: .
- specs:
- database_cleaner-sequel (1.8.0)
- database_cleaner (~> 1.8.0)
- sequel
-
-GEM
- remote: https://rubygems.org/
- specs:
- diff-lcs (1.3)
- mysql (2.9.1)
- mysql2 (0.3.18)
- pg (0.18.2)
- rake (10.4.2)
- rspec (3.7.0)
- rspec-core (~> 3.7.0)
- rspec-expectations (~> 3.7.0)
- rspec-mocks (~> 3.7.0)
- rspec-core (3.7.1)
- rspec-support (~> 3.7.0)
- rspec-expectations (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-mocks (3.7.0)
- diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.7.0)
- rspec-support (3.7.1)
- sequel (5.28.0)
- sqlite3 (1.3.10)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.16)
- database_cleaner!
- database_cleaner-sequel!
- mysql (~> 2.9.1)
- mysql2
- pg
- rake (~> 10.0)
- rspec (~> 3.0)
- sqlite3
-
-BUNDLED WITH
- 1.17.3
diff --git a/adapters/database_cleaner-sequel/LICENSE.txt b/adapters/database_cleaner-sequel/LICENSE.txt
deleted file mode 100644
index 392bc0d..0000000
--- a/adapters/database_cleaner-sequel/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2009 Ben Mabey
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/adapters/database_cleaner-sequel/README.md b/adapters/database_cleaner-sequel/README.md
deleted file mode 100644
index 3d2a5f2..0000000
--- a/adapters/database_cleaner-sequel/README.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Database Cleaner Adapter for Sequel
-
-[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-sequel.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-sequel)
-[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-sequel/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-sequel)
-
-Clean your Sequel databases with Database Cleaner.
-
-See https://github.com/DatabaseCleaner/database_cleaner for more information.
-
-## Installation
-
-```ruby
-# Gemfile
-group :test do
- gem 'database_cleaner-sequel'
-end
-```
-
-## Supported Strategies
-
-Here is an overview of the supported strategies:
-
-
-
-
- Truncation |
- Transaction |
- Deletion |
-
-
- Yes |
- Yes |
- Yes |
-
-
-
-
-(Default strategy is denoted in bold)
-
-## Configuration options
-
-
-
-
- ORM |
- How to access |
- Notes |
-
-
- Sequel |
- DatabaseCleaner[:sequel] |
- Multiple databases supported; specify DatabaseCleaner[:sequel, {:connection => Sequel.connect(uri)}] |
-
-
-
-
-## Common Errors
-
-### Nothing happens in JRuby with Sequel using transactions
-
-Due to an inconsistency in JRuby's implementation of Fibers, Sequel gives a different connection to `DatabaseCleaner.start` than is used for tests run between `.start` and `.clean`. This can be worked around by running your tests in a block like `DatabaseCleaner.cleaning { run_my_tests }` instead, which does not use Fibers.
-
-## COPYRIGHT
-
-See [LICENSE] for details.
diff --git a/adapters/database_cleaner-sequel/Rakefile b/adapters/database_cleaner-sequel/Rakefile
deleted file mode 100644
index b7e9ed5..0000000
--- a/adapters/database_cleaner-sequel/Rakefile
+++ /dev/null
@@ -1,6 +0,0 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-
-RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
diff --git a/adapters/database_cleaner-sequel/bin/console b/adapters/database_cleaner-sequel/bin/console
deleted file mode 100755
index 5dca81c..0000000
--- a/adapters/database_cleaner-sequel/bin/console
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-
-require "bundler/setup"
-require "database_cleaner/sequel"
-
-# You can add fixtures and/or initialization code here to make experimenting
-# with your gem easier. You can also use a different console, if you like.
-
-# (If you use this, don't forget to add pry to your Gemfile!)
-# require "pry"
-# Pry.start
-
-require "irb"
-IRB.start(__FILE__)
diff --git a/adapters/database_cleaner-sequel/bin/setup b/adapters/database_cleaner-sequel/bin/setup
deleted file mode 100755
index 268b1b4..0000000
--- a/adapters/database_cleaner-sequel/bin/setup
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
-
-bundle check || bundle install
-cp spec/support/sample.config.yml spec/support/config.yml
-
diff --git a/adapters/database_cleaner-sequel/database_cleaner-sequel.gemspec b/adapters/database_cleaner-sequel/database_cleaner-sequel.gemspec
deleted file mode 100644
index c4ba6fc..0000000
--- a/adapters/database_cleaner-sequel/database_cleaner-sequel.gemspec
+++ /dev/null
@@ -1,35 +0,0 @@
-
-lib = File.expand_path("../lib", __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require "database_cleaner/sequel/version"
-
-Gem::Specification.new do |spec|
- spec.name = "database_cleaner-sequel"
- spec.version = DatabaseCleaner::Sequel::VERSION
- spec.authors = ["Ernesto Tagwerker"]
- spec.email = ["ernesto@ombulabs.com"]
-
- spec.summary = "Strategies for cleaning databases using Sequel. Can be used to ensure a clean state for testing."
- spec.description = "Strategies for cleaning databases using Sequel. Can be used to ensure a clean state for testing."
- spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-sequel"
- spec.license = "MIT"
-
- spec.add_dependency "database_cleaner", "~> 1.8.0"
- spec.add_dependency "sequel"
-
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
- f.match(%r{^(test|spec|features)/})
- end
- spec.bindir = "exe"
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
- spec.require_paths = ["lib"]
-
- spec.add_development_dependency "bundler", "~> 1.16"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
-
- spec.add_development_dependency 'mysql', '~> 2.9.1'
- spec.add_development_dependency 'mysql2'
- spec.add_development_dependency 'pg'
- spec.add_development_dependency "sqlite3"
-end
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner-sequel.rb b/adapters/database_cleaner-sequel/lib/database_cleaner-sequel.rb
deleted file mode 100644
index 4648ad6..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner-sequel.rb
+++ /dev/null
@@ -1 +0,0 @@
-require "database_cleaner/sequel"
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel.rb b/adapters/database_cleaner-sequel/lib/database_cleaner/sequel.rb
deleted file mode 100644
index df26e45..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require "database_cleaner/sequel/version"
-require "database_cleaner"
-require "database_cleaner/sequel/truncation"
-require "database_cleaner/sequel/transaction"
-require "database_cleaner/sequel/deletion"
-
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/base.rb b/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/base.rb
deleted file mode 100644
index 37a8d4a..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/base.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'database_cleaner/generic/base'
-module DatabaseCleaner
- module Sequel
- def self.available_strategies
- %w(truncation transaction deletion)
- end
-
- def self.default_strategy
- :transaction
- end
-
- module Base
- include ::DatabaseCleaner::Generic::Base
-
- def db=(desired_db)
- @db = desired_db
- end
-
- def db
- return @db if @db && @db != :default
- raise "As you have more than one active sequel database you have to specify the one to use manually!" if ::Sequel::DATABASES.count > 1
- ::Sequel::DATABASES.first || :default
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/deletion.rb b/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/deletion.rb
deleted file mode 100644
index 58e240d..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/deletion.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require 'database_cleaner/sequel/base'
-require 'database_cleaner/generic/truncation'
-require 'database_cleaner/sequel/truncation'
-
-module DatabaseCleaner::Sequel
- class Deletion < Truncation
- def disable_referential_integrity(tables)
- case db.database_type
- when :postgres
- db.run('SET CONSTRAINTS ALL DEFERRED')
- tables_to_truncate(db).each do |table|
- db.run("ALTER TABLE \"#{table}\" DISABLE TRIGGER ALL")
- end
- when :mysql
- old = db.fetch('SELECT @@FOREIGN_KEY_CHECKS').first[:@@FOREIGN_KEY_CHECKS]
- db.run('SET FOREIGN_KEY_CHECKS = 0')
- end
- yield
- ensure
- case db.database_type
- when :postgres
- tables.each do |table|
- db.run("ALTER TABLE \"#{table}\" ENABLE TRIGGER ALL")
- end
- when :mysql
- db.run("SET FOREIGN_KEY_CHECKS = #{old}")
- end
- end
-
- def delete_tables(db, tables)
- tables.each do |table|
- db[table.to_sym].delete
- end
- end
-
- def clean
- return unless dirty?
-
- tables = tables_to_truncate(db)
- db.transaction do
- disable_referential_integrity(tables) do
- delete_tables(db, tables)
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/transaction.rb b/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/transaction.rb
deleted file mode 100644
index 03e1a6d..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/transaction.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'database_cleaner/sequel/base'
-module DatabaseCleaner
- module Sequel
- class Transaction
- include ::DatabaseCleaner::Sequel::Base
-
- def self.check_fiber_brokenness
- if !@checked_fiber_brokenness && Fiber.new { Thread.current }.resume != Thread.current
- raise RuntimeError, "This ruby engine's Fibers are not compatible with Sequel's connection pool. " +
- "To work around this, please use DatabaseCleaner.cleaning with a block instead of " +
- "DatabaseCleaner.start and DatabaseCleaner.clean"
- end
- @checked_fiber_brokenness = true
- end
-
- def start
- self.class.check_fiber_brokenness
-
- @fibers ||= []
- db = self.db
- f = Fiber.new do
- db.transaction(:rollback => :always, :savepoint => true) do
- Fiber.yield
- end
- end
- f.resume
- @fibers << f
- end
-
- def clean
- f = @fibers.pop
- f.resume
- end
-
- def cleaning
- self.db.transaction(:rollback => :always, :savepoint => true) { yield }
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/truncation.rb b/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/truncation.rb
deleted file mode 100644
index 397be89..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/truncation.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-require 'database_cleaner/generic/truncation'
-require 'database_cleaner/sequel/base'
-
-module DatabaseCleaner
- module Sequel
- class Truncation
- include ::DatabaseCleaner::Sequel::Base
- include ::DatabaseCleaner::Generic::Truncation
-
- def start
- @last_txid = txid
- end
-
- def clean
- return unless dirty?
-
- tables = tables_to_truncate(db)
-
- # Count rows before truncating
- if pre_count?
- tables = pre_count_tables(tables)
- end
-
- case db.database_type
- when :postgres
- # PostgreSQL requires all tables with FKs to be truncates in the same command, or have the CASCADE keyword
- # appended. Bulk truncation without CASCADE is:
- # * Safer. Tables outside of tables_to_truncate won't be affected.
- # * Faster. Less roundtrips to the db.
- unless tables.empty?
- tables_sql = tables.map { |t| %("#{t}") }.join(',')
- db.run "TRUNCATE TABLE #{tables_sql} RESTART IDENTITY;"
- end
- else
- truncate_tables(db, tables)
- end
- end
-
- private
-
- def pre_count_tables tables
- tables.reject { |table| db[table.to_sym].count == 0 }
- end
-
- def truncate_tables(db, tables)
- tables.each do |table|
- db[table.to_sym].truncate
- if db.database_type == :sqlite && db.table_exists?(:sqlite_sequence)
- db[:sqlite_sequence].where(name: table).delete
- end
- end
- end
-
- def dirty?
- @last_txid != txid || @last_txid.nil?
- end
-
- def txid
- case db.database_type
- when :postgres
- db.fetch('SELECT txid_snapshot_xmax(txid_current_snapshot()) AS txid').first[:txid]
- end
- end
-
- def tables_to_truncate(db)
- (@only || db.tables.map(&:to_s)) - @tables_to_exclude
- end
-
- # overwritten
- def migration_storage_names
- %w(schema_info schema_migrations)
- end
-
- def pre_count?
- @pre_count == true
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/version.rb b/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/version.rb
deleted file mode 100644
index a482d60..0000000
--- a/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/version.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module DatabaseCleaner
- module Sequel
- VERSION = "1.8.0"
- end
-end
diff --git a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/base_spec.rb b/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/base_spec.rb
deleted file mode 100644
index 10b46b3..0000000
--- a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/base_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'database_cleaner/sequel/base'
-require 'database_cleaner/spec'
-require 'sequel'
-
-module DatabaseCleaner
- RSpec.describe Sequel do
- it { is_expected.to respond_to(:available_strategies) }
-
- it "has a default_strategy of transaction" do
- expect(described_class.default_strategy).to eq(:transaction)
- end
- end
-
- module Sequel
- class ExampleStrategy
- include ::DatabaseCleaner::Sequel::Base
- end
-
- RSpec.describe ExampleStrategy do
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- pending "I figure out how to use Sequel and write some real tests for it..."
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/deletion_spec.rb b/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/deletion_spec.rb
deleted file mode 100644
index 289c86e..0000000
--- a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/deletion_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'database_cleaner/sequel/deletion'
-require 'database_cleaner/spec'
-require 'support/sequel_helper'
-
-module DatabaseCleaner
- module Sequel
- RSpec.describe Deletion do
- it_should_behave_like "a generic strategy"
-
- SequelHelper.with_all_dbs do |helper|
- context "using a #{helper.db} connection" do
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- let(:connection) { helper.connection }
-
- before { subject.db = connection }
-
- context 'when several tables have data' do
- before do
- connection[:users].insert
- connection[:agents].insert
- end
-
- context 'by default' do
- it 'deletes all the tables' do
- subject.clean
-
- expect(connection[:users]).to be_empty
- expect(connection[:agents]).to be_empty
- end
- end
- end
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/transaction_spec.rb b/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/transaction_spec.rb
deleted file mode 100644
index 3141d04..0000000
--- a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/transaction_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'database_cleaner/sequel/transaction'
-require 'database_cleaner/spec'
-require 'support/sequel_helper'
-
-module DatabaseCleaner
- module Sequel
- RSpec.describe Transaction do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic transaction strategy"
-
- describe "start" do
- it "should start a transaction"
- end
-
- describe "clean" do
- it "should finish a transaction"
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/truncation_spec.rb b/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/truncation_spec.rb
deleted file mode 100644
index 52166cb..0000000
--- a/adapters/database_cleaner-sequel/spec/database_cleaner/sequel/truncation_spec.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require 'database_cleaner/sequel/truncation'
-require 'database_cleaner/spec'
-require 'support/sequel_helper'
-
-module DatabaseCleaner
- module Sequel
- RSpec.describe Truncation do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic truncation strategy"
-
- SequelHelper.with_all_dbs do |helper|
- context "using a #{helper.db} connection" do
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- let(:connection) { helper.connection }
-
- before { subject.db = connection }
-
- context 'when several tables have data' do
- before do
- connection[:users].insert
- connection[:agents].insert
- end
-
- context 'by default' do
- it 'truncates all the tables' do
- subject.clean
-
- expect(connection[:users]).to be_empty
- expect(connection[:agents]).to be_empty
- end
- end
-
- context 'restricted to "only: [...]" some tables' do
- subject { described_class.new(only: ['users']) }
-
- it 'truncates only the mentioned tables (and leaves the rest alone)' do
- subject.clean
-
- expect(connection[:users]).to be_empty
- expect(connection[:agents].count).to eq(1)
- end
- end
-
- context 'restricted to "except: [...]" some tables' do
- subject { described_class.new(except: ['users']) } # XXX: Strings only, symbols are ignored
-
- it 'leaves the mentioned tables alone (and truncates the rest)' do
- subject.clean
-
- expect(connection[:users].count).to eq(1)
- expect(connection[:agents]).to be_empty
- end
- end
- end
-
- describe 'auto increment sequences' do
- it "resets AUTO_INCREMENT primary key seqeunce" do
- table = connection[:users]
- 2.times { table.insert }
-
- subject.clean
-
- id_after_clean = table.insert
- expect(id_after_clean).to eq 1
- end
- end
-
- describe "with pre_count optimization option" do
- subject { described_class.new(pre_count: true) }
-
- before { connection[:users].insert }
-
- it "only truncates non-empty tables" do
- sql = case helper.db
- when :sqlite3 then ["DELETE FROM `users`", anything]
- when :postgres then ['TRUNCATE TABLE "users" RESTART IDENTITY;', anything]
- else ["TRUNCATE TABLE `users`", anything]
- end
- expect(subject.db).to receive(:execute_ddl).once.with(*sql)
- subject.clean
- end
- end
- end
- end
- end
- end
-end
diff --git a/adapters/database_cleaner-sequel/spec/spec_helper.rb b/adapters/database_cleaner-sequel/spec/spec_helper.rb
deleted file mode 100644
index 57b06b5..0000000
--- a/adapters/database_cleaner-sequel/spec/spec_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "bundler/setup"
-require "database_cleaner/sequel"
-
-RSpec.configure do |config|
- # Enable flags like --only-failures and --next-failure
- config.example_status_persistence_file_path = ".rspec_status"
-
- # Disable RSpec exposing methods globally on `Module` and `main`
- config.disable_monkey_patching!
-
- config.expect_with :rspec do |c|
- c.syntax = :expect
- end
-end
diff --git a/adapters/database_cleaner-sequel/spec/support/sample.config.yml b/adapters/database_cleaner-sequel/spec/support/sample.config.yml
deleted file mode 100644
index 90132c0..0000000
--- a/adapters/database_cleaner-sequel/spec/support/sample.config.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-mysql:
- adapter: mysql
- database: database_cleaner_test
- username: root
- password:
- host: 127.0.0.1
- port: 3306
- encoding: utf8
-
-mysql2:
- adapter: mysql2
- database: database_cleaner_test
- username: root
- password:
- host: 127.0.0.1
- port: 3306
- encoding: utf8
-
-postgres:
- adapter: postgresql
- database: database_cleaner_test
- username: postgres
- password:
- host: 127.0.0.1
- encoding: unicode
- template: template0
-
-sqlite3:
- adapter: sqlite3
- database: tmp/database_cleaner_test.sqlite3
- pool: 5
- timeout: 5000
- encoding: utf8
-
diff --git a/adapters/database_cleaner-sequel/spec/support/sequel_helper.rb b/adapters/database_cleaner-sequel/spec/support/sequel_helper.rb
deleted file mode 100644
index d62020f..0000000
--- a/adapters/database_cleaner-sequel/spec/support/sequel_helper.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'sequel'
-require 'database_cleaner/spec/database_helper'
-
-class SequelHelper < DatabaseCleaner::Spec::DatabaseHelper
- private
-
- def establish_connection(config = default_config)
- url = "#{db}:///"
- url = "sqlite:///" if db == :sqlite3
- @connection = ::Sequel.connect(url, config)
- end
-end
diff --git a/adapters/database_cleaner-sequel/tmp/.keep b/adapters/database_cleaner-sequel/tmp/.keep
deleted file mode 100644
index e69de29..0000000
diff --git a/bin/setup b/bin/setup
index d852b97..268b1b4 100755
--- a/bin/setup
+++ b/bin/setup
@@ -6,7 +6,3 @@ set -vx
bundle check || bundle install
cp spec/support/sample.config.yml spec/support/config.yml
-for adapter in adapters/*; do
- (cd $adapter && bin/setup)
-done
-
diff --git a/spec/database_cleaner/active_record/base_spec.rb b/spec/database_cleaner/active_record/base_spec.rb
deleted file mode 100644
index 48f2eb3..0000000
--- a/spec/database_cleaner/active_record/base_spec.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-require 'active_record'
-require 'database_cleaner/active_record/base'
-require 'database_cleaner/spec'
-
-class FakeModel
- def self.connection
- :fake_connection
- end
-end
-
-RSpec.describe DatabaseCleaner::ActiveRecord do
- it { is_expected.to respond_to(:available_strategies) }
-
- describe "config_file_location" do
- after do
- # prevent global state leakage
- DatabaseCleaner::ActiveRecord.config_file_location=nil
- DatabaseCleaner.app_root = nil
- end
-
- it "should default to \#{DatabaseCleaner.app_root}/config/database.yml" do
- DatabaseCleaner::ActiveRecord.config_file_location = nil
- DatabaseCleaner.app_root = "/path/to"
- expect(DatabaseCleaner::ActiveRecord.config_file_location).to eq '/path/to/config/database.yml'
- end
- end
-end
-
-module DatabaseCleaner
- module ActiveRecord
- class ExampleStrategy
- include DatabaseCleaner::ActiveRecord::Base
- end
-
- RSpec.describe ExampleStrategy do
- let(:config_location) { '/path/to/config/database.yml' }
-
- around do |example|
- DatabaseCleaner::ActiveRecord.config_file_location = config_location
- example.run
- DatabaseCleaner::ActiveRecord.config_file_location = nil
- end
-
- it_should_behave_like "a generic strategy"
-
- describe "db" do
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
-
- describe "db=" do
- let(:config_location) { "spec/support/example.database.yml" }
-
- it "should process erb in the config" do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one" })
- end
-
- context 'when config file differs from established ActiveRecord configuration' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return({ "my_db" => { "database" => "two"} })
- end
-
- it 'uses the ActiveRecord configuration' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "two"})
- end
- end
-
- context 'when config file agrees with ActiveRecord configuration' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return({ "my_db" => { "database" => "one"} })
- end
-
- it 'uses the config file' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one"})
- end
- end
-
- context 'when ::ActiveRecord::Base.configurations nil' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return(nil)
- end
-
- it 'uses the config file' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one"})
- end
- end
-
- context 'when ::ActiveRecord::Base.configurations empty' do
- before do
- allow(::ActiveRecord::Base).to receive(:configurations).and_return({})
- end
-
- it 'uses the config file' do
- subject.db = :my_db
- expect(subject.connection_hash).to eq({ "database" => "one"})
- end
- end
-
- context 'when config file is not available' do
- before do
- allow(File).to receive(:file?).with(config_location).and_return(false)
- end
-
- it "should skip config" do
- subject.db = :my_db
- expect(subject.connection_hash).not_to be
- end
- end
-
- it "skips the file when the model is set" do
- subject.db = FakeModel
- expect(subject.connection_hash).not_to be
- end
-
- it "skips the file when the db is set to :default" do
- # to avoid https://github.com/bmabey/database_cleaner/issues/72
- subject.db = :default
- expect(subject.connection_hash).not_to be
- end
- end
-
- describe "connection_class" do
- it "should default to ActiveRecord::Base" do
- expect(subject.connection_class).to eq ::ActiveRecord::Base
- end
-
- context "with database models" do
- context "connection_hash is set" do
- it "reuses the model's connection" do
- subject.connection_hash = {}
- subject.db = FakeModel
- expect(subject.connection_class).to eq FakeModel
- end
- end
-
- context "connection_hash is not set" do
- it "reuses the model's connection" do
- subject.db = FakeModel
- expect(subject.connection_class).to eq FakeModel
- end
- end
- end
-
- context "when connection_hash is set" do
- let(:hash) { {} }
- before { subject.connection_hash = hash }
-
- it "establishes a connection with it" do
- expect(::ActiveRecord::Base).to receive(:establish_connection).with(hash)
- expect(subject.connection_class).to eq ::ActiveRecord::Base
- end
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/active_record/transaction_spec.rb b/spec/database_cleaner/active_record/transaction_spec.rb
deleted file mode 100644
index c6fbdb1..0000000
--- a/spec/database_cleaner/active_record/transaction_spec.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-require 'database_cleaner/active_record/transaction'
-require 'active_record'
-
-module DatabaseCleaner
- module ActiveRecord
-
- RSpec.describe Transaction do
- let(:connection) { double("connection") }
- let(:connection_2) { double("connection_2") }
- let(:connection_pool) { double("connection_pool") }
-
- before do
- allow(::ActiveRecord::Base).to receive(:connection_pool).and_return(connection_pool)
- allow(connection_pool).to receive(:connections).and_return([connection])
- allow(::ActiveRecord::Base).to receive(:connection).and_return(connection)
- end
-
- describe "#start" do
- [:begin_transaction, :begin_db_transaction].each do |begin_transaction_method|
- context "using #{begin_transaction_method}" do
- before do
- allow(connection).to receive(:transaction)
- allow(connection).to receive(begin_transaction_method)
- end
-
- it "should increment open transactions if possible" do
- expect(connection).to receive(:increment_open_transactions)
- subject.start
- end
-
- it "should tell ActiveRecord to increment connection if its not possible to increment current connection" do
- expect(::ActiveRecord::Base).to receive(:increment_open_transactions)
- subject.start
- end
-
- it "should start a transaction" do
- allow(connection).to receive(:increment_open_transactions)
- expect(connection).to receive(begin_transaction_method)
- expect(connection).to receive(:transaction)
- subject.start
- end
- end
- end
- end
-
- describe "#clean" do
- context "manual accounting of transaction count" do
- it "should start a transaction" do
- expect(connection).to receive(:open_transactions).and_return(1)
-
- allow(connection).to receive(:decrement_open_transactions)
-
- expect(connection).to receive(:rollback_db_transaction)
- subject.clean
- end
-
- it "should decrement open transactions if possible" do
- expect(connection).to receive(:open_transactions).and_return(1)
-
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(connection).to receive(:decrement_open_transactions)
- subject.clean
- end
-
- it "should not try to decrement or rollback if open_transactions is 0 for whatever reason" do
- expect(connection).to receive(:open_transactions).and_return(0)
-
- subject.clean
- end
-
- it "should decrement connection via ActiveRecord::Base if connection won't" do
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(::ActiveRecord::Base).to receive(:decrement_open_transactions)
- subject.clean
- end
-
- it "should rollback open transactions in all connections" do
- allow(connection_pool).to receive(:connections).and_return([connection, connection_2])
-
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(connection_2).to receive(:open_transactions).and_return(1)
- allow(connection_2).to receive(:rollback_db_transaction)
-
- expect(::ActiveRecord::Base).to receive(:decrement_open_transactions).twice
- subject.clean
- end
-
- it "should rollback open transactions in all connections with an open transaction" do
- allow(connection_pool).to receive(:connections).and_return([connection, connection_2])
-
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_db_transaction)
-
- expect(connection_2).to receive(:open_transactions).and_return(0)
-
- expect(::ActiveRecord::Base).to receive(:decrement_open_transactions).exactly(1).times
- subject.clean
- end
- end
-
- context "automatic accounting of transaction count (AR 4)" do
- before { stub_const("ActiveRecord::VERSION::MAJOR", 4) }
-
- it "should start a transaction" do
- allow(connection).to receive(:rollback_db_transaction)
- expect(connection).to receive(:open_transactions).and_return(1)
-
- expect(connection).not_to receive(:decrement_open_transactions)
- expect(connection).to receive(:rollback_transaction)
- subject.clean
- end
-
- it "should decrement open transactions if possible" do
- allow(connection).to receive(:rollback_transaction)
- expect(connection).to receive(:open_transactions).and_return(1)
-
- expect(connection).not_to receive(:decrement_open_transactions)
- subject.clean
- end
-
- it "should not try to decrement or rollback if open_transactions is 0 for whatever reason" do
- expect(connection).to receive(:open_transactions).and_return(0)
-
- subject.clean
- end
-
- it "should decrement connection via ActiveRecord::Base if connection won't" do
- expect(connection).to receive(:open_transactions).and_return(1)
- allow(connection).to receive(:rollback_transaction)
-
- expect(::ActiveRecord::Base).not_to receive(:decrement_open_transactions)
- subject.clean
- end
- end
- end
-
- describe "#connection_maintains_transaction_count?" do
- it "should return true if the major active record version is < 4" do
- stub_const("ActiveRecord::VERSION::MAJOR", 3)
- expect(subject.connection_maintains_transaction_count?).to be_truthy
- end
-
- it "should return false if the major active record version is > 3" do
- stub_const("ActiveRecord::VERSION::MAJOR", 4)
- expect(subject.connection_maintains_transaction_count?).to be_falsey
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/active_record/truncation_spec.rb b/spec/database_cleaner/active_record/truncation_spec.rb
deleted file mode 100644
index fff56b5..0000000
--- a/spec/database_cleaner/active_record/truncation_spec.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-require 'support/active_record_helper'
-require 'database_cleaner/active_record/truncation'
-
-RSpec.describe DatabaseCleaner::ActiveRecord::Truncation do
- ActiveRecordHelper.with_all_dbs do |helper|
- context "using a #{helper.db} connection" do
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- let(:connection) { helper.connection }
-
- before do
- allow(connection).to receive(:disable_referential_integrity).and_yield
- allow(connection).to receive(:database_cleaner_view_cache).and_return([])
- end
-
- describe '#clean' do
- context "with records" do
- before do
- 2.times { User.create! }
- 2.times { Agent.create! }
- end
-
- it "should truncate all tables" do
- expect { subject.clean }
- .to change { [User.count, Agent.count] }
- .from([2,2])
- .to([0,0])
- end
-
- it "should reset AUTO_INCREMENT index of table" do
- subject.clean
- expect(User.create.id).to eq 1
- end
-
- xit "should not reset AUTO_INCREMENT index of table if :reset_ids is false" do
- described_class.new(reset_ids: false).clean
- expect(User.create.id).to eq 3
- end
-
- it "should truncate all tables except for schema_migrations" do
- subject.clean
- count = connection.select_value("select count(*) from schema_migrations;").to_i
- expect(count).to eq 2
- end
-
- it "should only truncate the tables specified in the :only option when provided" do
- expect { described_class.new(only: ['agents']).clean }
- .to change { [User.count, Agent.count] }
- .from([2,2])
- .to([2,0])
- end
-
- it "should not truncate the tables specified in the :except option" do
- expect { described_class.new(except: ['users']).clean }
- .to change { [User.count, Agent.count] }
- .from([2,2])
- .to([2,0])
- end
-
- it "should raise an error when :only and :except options are used" do
- expect {
- described_class.new(except: ['widgets'], only: ['widgets'])
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when invalid options are provided" do
- expect { described_class.new(foo: 'bar') }.to raise_error(ArgumentError)
- end
-
- it "should not truncate views" do
- allow(connection).to receive(:database_cleaner_table_cache).and_return(%w[widgets dogs])
- allow(connection).to receive(:database_cleaner_view_cache).and_return(["widgets"])
-
- expect(connection).to receive(:truncate_tables).with(['dogs'])
-
- subject.clean
- end
- end
-
- describe "with pre_count optimization option" do
- subject { described_class.new(pre_count: true) }
-
- it "only truncates non-empty tables" do
- pending if helper.db == :sqlite3
- pending if helper.db == :postgres
-
- User.create!
-
- expect(connection).to receive(:truncate_tables).with(['users'])
- subject.clean
- end
- end
-
- context 'when :cache_tables is set to true' do
- it 'caches the list of tables to be truncated' do
- expect(connection).to receive(:database_cleaner_table_cache).and_return([])
- expect(connection).not_to receive(:tables)
-
- allow(connection).to receive(:truncate_tables)
- described_class.new(cache_tables: true).clean
- end
- end
-
- context 'when :cache_tables is set to false' do
- it 'does not cache the list of tables to be truncated' do
- expect(connection).not_to receive(:database_cleaner_table_cache)
- expect(connection).to receive(:tables).and_return([])
-
- allow(connection).to receive(:truncate_tables)
- described_class.new(cache_tables: false).clean
- end
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/couch_potato/truncation_spec.rb b/spec/database_cleaner/couch_potato/truncation_spec.rb
deleted file mode 100644
index 8f4360a..0000000
--- a/spec/database_cleaner/couch_potato/truncation_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'database_cleaner/couch_potato/truncation'
-require 'couch_potato'
-
-module DatabaseCleaner
- module CouchPotato
-
- RSpec.describe Truncation do
- let(:database) { double('database') }
-
- before(:each) do
- allow(::CouchPotato).to receive(:couchrest_database).and_return(database)
- end
-
- it "should re-create the database" do
- expect(database).to receive(:recreate!)
-
- Truncation.new.clean
- end
-
- it "should raise an error when the :only option is used" do
- expect {
- Truncation.new(:only => ['document-type'])
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when the :except option is used" do
- expect {
- Truncation.new(:except => ['document-type'])
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when invalid options are provided" do
- expect {
- Truncation.new(:foo => 'bar')
- }.to raise_error(ArgumentError)
- end
- end
-
- end
-end
diff --git a/spec/database_cleaner/data_mapper/base_spec.rb b/spec/database_cleaner/data_mapper/base_spec.rb
deleted file mode 100644
index 9996763..0000000
--- a/spec/database_cleaner/data_mapper/base_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'database_cleaner/data_mapper/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe DataMapper do
- it { is_expected.to respond_to(:available_strategies) }
- end
-
- module DataMapper
- class ExampleStrategy
- include ::DatabaseCleaner::DataMapper::Base
- end
-
- RSpec.describe ExampleStrategy do
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
- end
-end
diff --git a/spec/database_cleaner/data_mapper/transaction_spec.rb b/spec/database_cleaner/data_mapper/transaction_spec.rb
deleted file mode 100644
index 61e0431..0000000
--- a/spec/database_cleaner/data_mapper/transaction_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'database_cleaner/data_mapper/transaction'
-require 'database_cleaner/spec'
-#require 'data_mapper'
-
-module DatabaseCleaner
- module DataMapper
-
- RSpec.describe Transaction do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic transaction strategy"
-
- describe "start" do
- it "should start a transaction"
- end
-
- describe "clean" do
- it "should finish a transaction"
- end
- end
-
- end
-end
diff --git a/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb b/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb
deleted file mode 100644
index 3a25d1b..0000000
--- a/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'support/data_mapper_helper'
-require 'database_cleaner/data_mapper/truncation'
-
-RSpec.describe DatabaseCleaner::DataMapper::Truncation do
- let(:helper) { DataMapperHelper.new(:sqlite3) }
-
- let(:connection) { helper.connection }
-
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- describe "DM connection adapter monkeypatches" do
- before { 2.times { User.create } }
-
- describe "#truncate_table" do
- it "truncates the table and resets AUTO_INCREMENT index of table" do
- connection.truncate_table(User.storage_names[:default])
- expect(User.count).to eq 0
- expect(User.create.id).to eq 1
- end
- end
- end
-end
diff --git a/spec/database_cleaner/data_mapper/truncation_spec.rb b/spec/database_cleaner/data_mapper/truncation_spec.rb
deleted file mode 100644
index b879b90..0000000
--- a/spec/database_cleaner/data_mapper/truncation_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'database_cleaner/data_mapper/truncation'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- module DataMapper
- RSpec.describe Truncation do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic truncation strategy"
- end
- end
-end
diff --git a/spec/database_cleaner/generic/base_spec.rb b/spec/database_cleaner/generic/base_spec.rb
deleted file mode 100644
index 4f9674d..0000000
--- a/spec/database_cleaner/generic/base_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'database_cleaner/spec'
-require 'database_cleaner/generic/base'
-require 'active_record'
-
-module ::DatabaseCleaner
- module Generic
- class ExampleStrategy
- include ::DatabaseCleaner::Generic::Base
-
- def start; end
- end
-
- RSpec.describe ExampleStrategy do
- context "class methods" do
- subject { ExampleStrategy }
-
- describe "#available_strategies" do
- it "should have available strategies" do
- expect(subject.available_strategies).to be_empty
- end
- end
- end
-
- it_should_behave_like "a generic strategy"
-
- describe "#db" do
- it "should be :default" do
- expect(subject.db).to eql(:default)
- end
- end
-
- describe "#cleaning" do
- let (:connection) { double("connection") }
- let (:strategy) { ExampleStrategy.new }
- before do
- # DatabaseCleaner.strategy = :truncation
- allow(connection).to receive(:disable_referential_integrity).and_yield
- allow(connection).to receive(:database_cleaner_view_cache).and_return([])
- allow(connection).to receive(:database_cleaner_table_cache).and_return([])
- allow(::ActiveRecord::Base).to receive(:connection).and_return(connection)
- end
-
- it "calls #clean even if there is an exception" do
- expect(strategy).to receive :clean
- expect do
- strategy.cleaning do
- raise NoMethodError
- end
- end.to raise_exception(NoMethodError)
- end
-
- it "calls #clean after processing the block" do
- expect(strategy).to receive :clean
- strategy.cleaning {}
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/generic/truncation_spec.rb b/spec/database_cleaner/generic/truncation_spec.rb
deleted file mode 100644
index e28d1cd..0000000
--- a/spec/database_cleaner/generic/truncation_spec.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'database_cleaner/generic/truncation'
-
-module ::DatabaseCleaner
- module Generic
- class TruncationExample
- include ::DatabaseCleaner::Generic::Truncation
-
- def only
- @only
- end
-
- def except
- @tables_to_exclude
- end
-
- def reset_ids?
- !!@reset_ids
- end
-
- def pre_count?
- !!@pre_count
- end
- end
-
- class TruncationExampleWithMigrations < TruncationExample
- def migration_storage_names
- %w[migration_storage_name]
- end
- end
-
- RSpec.describe TruncationExample do
- it "will start" do
- expect { subject.start }.to_not raise_error
- end
-
- it "expects clean to be implemented later" do
- expect { subject.clean }.to raise_error(NotImplementedError)
- end
-
- context "private methods" do
- it { is_expected.not_to respond_to(:tables_to_truncate) }
-
- it 'expects #tables_to_truncate to be implemented later' do
- expect{ subject.send :tables_to_truncate }.to raise_error(NotImplementedError)
- end
-
- it { is_expected.not_to respond_to(:migration_storage_names) }
- end
-
- describe "initialize" do
- it "should accept no options" do
- described_class.new
- end
-
- it "should accept a hash of options" do
- described_class.new({})
- end
-
- describe ":only option" do
- it "defaults to nil" do
- expect(subject.only).to be_nil
- end
-
- it "can be set to specify tables to clean" do
- subject = described_class.new(only: ["something"])
- expect(subject.only).to eq ["something"]
- end
- end
-
- describe ":except option" do
- it "defaults to empty array" do
- expect(subject.except).to eq []
- end
-
- it "can be set to specify tables to skip" do
- subject = described_class.new(except: ["something"])
- expect(subject.except).to eq ["something"]
- end
- end
-
- describe ":pre_count option" do
- it "defaults to false" do
- expect(subject.pre_count?).to eq false
- end
-
- it "can be set" do
- subject = described_class.new(pre_count: "something")
- expect(subject.pre_count?).to eq true
- end
- end
-
- describe ":reset_ids option" do
- it "defaults to false" do
- expect(subject.reset_ids?).to eq false
- end
-
- it "can be set" do
- subject = described_class.new(reset_ids: "something")
- expect(subject.reset_ids?).to eq true
- end
- end
-
- it "should raise an error when invalid options are provided" do
- expect {
- described_class.new(a_random_param: "should raise ArgumentError")
- }.to raise_error(ArgumentError)
- end
-
- it "should raise an error when :only and :except options are used" do
- expect {
- described_class.new(except: "something", only: "something else")
- }.to raise_error(ArgumentError)
- end
-
- describe TruncationExampleWithMigrations do
- it { expect(subject.only).to eq nil }
- it { expect(subject.except).to eq %w[migration_storage_name] }
-
- it "should not mutate the array of excepted tables" do
- except_tables = ["something"]
- subject = described_class.new(except: except_tables)
- expect(subject.except).to eq ["something", "migration_storage_name"]
- expect(except_tables).to eq ["something"]
- end
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/mongo/mongo_examples.rb b/spec/database_cleaner/mongo/mongo_examples.rb
deleted file mode 100644
index 0360294..0000000
--- a/spec/database_cleaner/mongo/mongo_examples.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module MongoTest
- class Base
- def self.collection
- @connection ||= Mongo::Connection.new('127.0.0.1')
- @db ||= @connection.db('database_cleaner_specs')
- @collection ||= @db.collection(name) || @db.create_collection(name)
- end
-
- def self.count
- @collection.count
- end
-
- def initialize(attrs={})
- @attrs = attrs
- end
-
- def save!
- self.class.collection.insert(@attrs)
- end
- end
-
- class Widget < Base
- end
- class Gadget < Base
- end
-end
diff --git a/spec/database_cleaner/mongo/truncation_spec.rb b/spec/database_cleaner/mongo/truncation_spec.rb
deleted file mode 100644
index 9cf1dff..0000000
--- a/spec/database_cleaner/mongo/truncation_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'mongo'
-require 'database_cleaner/mongo/truncation'
-require File.dirname(__FILE__) + '/mongo_examples'
-
-RSpec.describe DatabaseCleaner::Mongo::Truncation do
- around do |example|
- connection = Mongo::Connection.new('127.0.0.1')
- db_name = 'database_cleaner_specs'
- db = connection.db(db_name)
- subject.db = db
-
- example.run
-
- connection.drop_database(db_name)
- end
-
- before do
- MongoTest::Widget.new(name: 'some widget').save!
- MongoTest::Gadget.new(name: 'some gadget').save!
- end
-
- context "by default" do
- it "truncates all collections" do
- expect { subject.clean }.to change {
- [MongoTest::Widget.count, MongoTest::Gadget.count]
- }.from([1,1]).to([0,0])
- end
- end
-
- context "when collections are provided to the :only option" do
- subject { described_class.new(only: ['MongoTest::Widget']) }
-
- it "only truncates the specified collections" do
- expect { subject.clean }.to change {
- [MongoTest::Widget.count, MongoTest::Gadget.count]
- }.from([1,1]).to([0,1])
- end
- end
-
- context "when collections are provided to the :except option" do
- subject { described_class.new(except: ['MongoTest::Widget']) }
-
- it "truncates all but the specified collections" do
- expect { subject.clean }.to change {
- [MongoTest::Widget.count, MongoTest::Gadget.count]
- }.from([1,1]).to([1,0])
- end
- end
-end
-
diff --git a/spec/database_cleaner/mongo_mapper/base_spec.rb b/spec/database_cleaner/mongo_mapper/base_spec.rb
deleted file mode 100644
index e45f345..0000000
--- a/spec/database_cleaner/mongo_mapper/base_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'database_cleaner/mongo_mapper/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe MongoMapper do
- it { is_expected.to respond_to(:available_strategies) }
- end
-
- module MongoMapper
- class ExampleStrategy
- include ::DatabaseCleaner::MongoMapper::Base
- end
-
- RSpec.describe ExampleStrategy do
-
- it_should_behave_like "a generic strategy"
-
- describe "db" do
- it { is_expected.to respond_to(:db=) }
-
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/mongo_mapper/mongo_examples.rb b/spec/database_cleaner/mongo_mapper/mongo_examples.rb
deleted file mode 100644
index f0b8a73..0000000
--- a/spec/database_cleaner/mongo_mapper/mongo_examples.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module MongoMapperTest
- class Widget
- include ::MongoMapper::Document
- key :name, String
- end
- class Gadget
- include ::MongoMapper::Document
- key :name, String
- end
-end
diff --git a/spec/database_cleaner/mongo_mapper/truncation_spec.rb b/spec/database_cleaner/mongo_mapper/truncation_spec.rb
deleted file mode 100644
index ce0a3f6..0000000
--- a/spec/database_cleaner/mongo_mapper/truncation_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require 'mongo_mapper'
-require 'database_cleaner/mongo_mapper/truncation'
-require File.dirname(__FILE__) + '/mongo_examples'
-
-RSpec.describe DatabaseCleaner::MongoMapper::Truncation do
- around do |example|
- MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
- db_name = 'database_cleaner_specs'
- MongoMapper.database = db_name
-
- example.run
-
- MongoMapper.connection.drop_database(db_name)
- end
-
- before do
- MongoMapperTest::Widget.new(name: 'some widget').save!
- MongoMapperTest::Gadget.new(name: 'some gadget').save!
- end
-
- context "by default" do
- it "truncates all collections" do
- expect { subject.clean }.to change {
- [MongoMapperTest::Widget.count, MongoMapperTest::Gadget.count]
- }.from([1,1]).to([0,0])
- end
- end
-
- context "when collections are provided to the :only option" do
- subject { described_class.new(only: ['mongo_mapper_test.widgets']) }
-
- it "only truncates the specified collections" do
- expect { subject.clean }.to change {
- [MongoMapperTest::Widget.count, MongoMapperTest::Gadget.count]
- }.from([1,1]).to([0,1])
- end
- end
-
- context "when collections are provided to the :except option" do
- subject { described_class.new(except: ['mongo_mapper_test.widgets']) }
-
- it "truncates all but the specified collections" do
- expect { subject.clean }.to change {
- [MongoMapperTest::Widget.count, MongoMapperTest::Gadget.count]
- }.from([1,1]).to([1,0])
- end
- end
-end
-
diff --git a/spec/database_cleaner/moped/moped_examples.rb b/spec/database_cleaner/moped/moped_examples.rb
deleted file mode 100644
index a144850..0000000
--- a/spec/database_cleaner/moped/moped_examples.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module MopedTest
- class Base
- def self.collection
- @db ||= 'database_cleaner_specs'
- @session ||= ::Moped::Session.new(['127.0.0.1:27017'], database: @db)
- @collection ||= @session[name]
- end
-
- def self.count
- @collection.find.count
- end
-
- def initialize(attrs={})
- @attrs = attrs
- end
-
- def save!
- self.class.collection.insert(@attrs)
- end
- end
-
- class Widget < Base
- end
- class Gadget < Base
- end
- class System < Base
- def self.collection
- super
- @collection = @session['system_logs']
- end
- end
-end
diff --git a/spec/database_cleaner/moped/truncation_spec.rb b/spec/database_cleaner/moped/truncation_spec.rb
deleted file mode 100644
index 758dcff..0000000
--- a/spec/database_cleaner/moped/truncation_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'moped'
-require 'database_cleaner/moped/truncation'
-require File.dirname(__FILE__) + '/moped_examples'
-
-RSpec.describe DatabaseCleaner::Moped::Truncation do
- around do |example|
- db_name = 'database_cleaner_specs'
- session = ::Moped::Session.new(['127.0.0.1:27017'], database: db_name)
- subject.db = db_name
-
- example.run
-
- session.drop
- session.command(getlasterror: 1)
- end
-
- before do
- MopedTest::Widget.new(name: 'some widget').save!
- MopedTest::Gadget.new(name: 'some gadget').save!
- MopedTest::System.new(name: 'some system').save!
- end
-
- context "by default" do
- it "truncates all collections" do
- expect { subject.clean }.to change {
- [MopedTest::Widget.count, MopedTest::Gadget.count, MopedTest::System.count]
- }.from([1,1,1]).to([0,0,0])
- end
- end
-
- context "when collections are provided to the :only option" do
- subject { described_class.new(only: ['MopedTest::Widget']) }
-
- it "only truncates the specified collections" do
- expect { subject.clean }.to change {
- [MopedTest::Widget.count, MopedTest::Gadget.count, MopedTest::System.count]
- }.from([1,1,1]).to([0,1,1])
- end
- end
-
- context "when collections are provided to the :except option" do
- subject { described_class.new(except: ['MopedTest::Widget']) }
-
- it "truncates all but the specified collections" do
- expect { subject.clean }.to change {
- [MopedTest::Widget.count, MopedTest::Gadget.count, MopedTest::System.count]
- }.from([1,1,1]).to([1,0,0])
- end
- end
-end
-
diff --git a/spec/database_cleaner/neo4j/base_spec.rb b/spec/database_cleaner/neo4j/base_spec.rb
deleted file mode 100644
index e0a1605..0000000
--- a/spec/database_cleaner/neo4j/base_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'database_cleaner/neo4j/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe Neo4j do
- it { is_expected.to respond_to(:available_strategies) }
- end
-
- module Neo4j
- class ExampleStrategy
- include ::DatabaseCleaner::Neo4j::Base
- end
-
- RSpec.describe ExampleStrategy do
-
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- it "should store my describe db" do
- db_conf = {:connection => {:type => :server_db, :path => 'http://localhost:7474'}}
- subject.db = db_conf
- expect(subject.db).to eq db_conf
- end
-
- it "should respect additional connection parameters" do
- db_conf = {:type => :server_db, :path => 'http://localhost:7474', basic_auth: {username: 'user', password: 'pass'}}
- subject.db = db_conf
- expect(stub_const("Neo4j::Session", double())).to receive(:open).with(:server_db, 'http://localhost:7474', {basic_auth: {username: 'user', password: 'pass'}}) { true }
- subject.start
- end
-
- it "should default to nil" do
- expect(subject.db).to be_nil
- end
-
- it "should return default configuration" do
- expect(subject.database).to eq(:type => :server_db, :path => 'http://localhost:7475/')
- end
- end
- end
-end
diff --git a/spec/database_cleaner/neo4j/transaction_spec.rb b/spec/database_cleaner/neo4j/transaction_spec.rb
deleted file mode 100644
index 1a130a9..0000000
--- a/spec/database_cleaner/neo4j/transaction_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'neo4j-core'
-require 'database_cleaner/neo4j/transaction'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- module Neo4j
-
- RSpec.describe Transaction do
- before(:all) do
- DatabaseCleaner[:neo4j, :connection => {:type => :server_db, :path => 'http://localhost:7474'}]
- end
-
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic transaction strategy"
-
- describe "start" do
- it "should start a transaction"
- end
-
- describe "clean" do
- it "should finish a transaction"
- end
- end
- end
-end
diff --git a/spec/database_cleaner/ohm/truncation_spec.rb b/spec/database_cleaner/ohm/truncation_spec.rb
deleted file mode 100644
index bee581e..0000000
--- a/spec/database_cleaner/ohm/truncation_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'ohm'
-require 'database_cleaner/ohm/truncation'
-
-module OhmTests
- class Widget < ::Ohm::Model
- attribute :name
- end
-
- class Gadget < ::Ohm::Model
- attribute :name
- end
-end
-
-RSpec.describe DatabaseCleaner::Ohm::Truncation do
- around do |example|
- config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
- Ohm.connect url: config['test']['url']
- @redis = Ohm.redis
-
- example.run
-
- @redis.flushdb
- end
-
- before do
- OhmTests::Widget.new(name: 'some widget').save
- OhmTests::Gadget.new(name: 'some gadget').save
- end
-
- context "by default" do
- it "truncates all keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(6).to(0)
- end
- end
-
- context "when keys are provided to the :only option" do
- subject { described_class.new(only: ['*Widget*']) }
-
- it "only truncates the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(6).to(3)
- expect(@redis.get('OhmTests::Gadget:id')).to eq '1'
- end
- end
-
- context "when keys are provided to the :except option" do
- subject { described_class.new(except: ['*Widget*']) }
-
- it "truncates all but the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(6).to(3)
- expect(@redis.get('OhmTests::Widget:id')).to eq '1'
- end
- end
-end
-
diff --git a/spec/database_cleaner/redis/base_spec.rb b/spec/database_cleaner/redis/base_spec.rb
deleted file mode 100644
index 69314c4..0000000
--- a/spec/database_cleaner/redis/base_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'redis'
-require 'database_cleaner/redis/base'
-require 'database_cleaner/spec'
-
-module DatabaseCleaner
- RSpec.describe Redis do
- it { is_expected.to respond_to(:available_strategies) }
- end
-
- module Redis
- class ExampleStrategy
- include ::DatabaseCleaner::Redis::Base
- end
-
- RSpec.describe ExampleStrategy do
-
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- context "when passing url" do
- it "should store my describe db" do
- url = 'redis://localhost:6379/2'
- subject.db = 'redis://localhost:6379/2'
- expect(subject.db).to eq url
- end
- end
-
- context "when passing connection" do
- it "should store my describe db" do
- connection = ::Redis.new :url => 'redis://localhost:6379/2'
- subject.db = connection
- expect(subject.db).to eq connection
- end
- end
-
- it "should default to :default" do
- expect(subject.db).to eq :default
- end
- end
- end
-end
diff --git a/spec/database_cleaner/redis/truncation_spec.rb b/spec/database_cleaner/redis/truncation_spec.rb
deleted file mode 100644
index 739648d..0000000
--- a/spec/database_cleaner/redis/truncation_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'redis'
-require 'database_cleaner/redis/truncation'
-
-RSpec.describe DatabaseCleaner::Redis::Truncation do
- around do |example|
- config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../../examples/config/redis.yml"))
- @redis = ::Redis.new :url => config['test']['url']
-
- example.run
-
- @redis.flushdb
- end
-
- before do
- @redis.set 'Widget', 1
- @redis.set 'Gadget', 1
- end
-
- context "by default" do
- it "truncates all keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(2).to(0)
- end
- end
-
- context "when keys are provided to the :only option" do
- subject { described_class.new(only: ['Widge*']) }
-
- it "only truncates the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(2).to(1)
- expect(@redis.get('Gadget')).to eq '1'
- end
- end
-
- context "when keys are provided to the :except option" do
- subject { described_class.new(except: ['Widg*']) }
-
- it "truncates all but the specified keys" do
- expect { subject.clean }.to change { @redis.keys.size }.from(2).to(1)
- expect(@redis.get('Widget')).to eq '1'
- end
- end
-end
-
diff --git a/spec/database_cleaner/sequel/base_spec.rb b/spec/database_cleaner/sequel/base_spec.rb
deleted file mode 100644
index 0ce4869..0000000
--- a/spec/database_cleaner/sequel/base_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'database_cleaner/sequel/base'
-require 'database_cleaner/spec'
-require 'sequel'
-
-module DatabaseCleaner
- RSpec.describe Sequel do
- it { is_expected.to respond_to(:available_strategies) }
- end
-
- module Sequel
- class ExampleStrategy
- include ::DatabaseCleaner::Sequel::Base
- end
-
- RSpec.describe ExampleStrategy do
- it_should_behave_like "a generic strategy"
- it { is_expected.to respond_to(:db) }
- it { is_expected.to respond_to(:db=) }
-
- it "should store my desired db" do
- subject.db = :my_db
- expect(subject.db).to eq :my_db
- end
-
- pending "I figure out how to use Sequel and write some real tests for it..."
- end
- end
-end
diff --git a/spec/database_cleaner/sequel/deletion_spec.rb b/spec/database_cleaner/sequel/deletion_spec.rb
deleted file mode 100644
index 289c86e..0000000
--- a/spec/database_cleaner/sequel/deletion_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'database_cleaner/sequel/deletion'
-require 'database_cleaner/spec'
-require 'support/sequel_helper'
-
-module DatabaseCleaner
- module Sequel
- RSpec.describe Deletion do
- it_should_behave_like "a generic strategy"
-
- SequelHelper.with_all_dbs do |helper|
- context "using a #{helper.db} connection" do
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- let(:connection) { helper.connection }
-
- before { subject.db = connection }
-
- context 'when several tables have data' do
- before do
- connection[:users].insert
- connection[:agents].insert
- end
-
- context 'by default' do
- it 'deletes all the tables' do
- subject.clean
-
- expect(connection[:users]).to be_empty
- expect(connection[:agents]).to be_empty
- end
- end
- end
- end
- end
- end
- end
-end
diff --git a/spec/database_cleaner/sequel/transaction_spec.rb b/spec/database_cleaner/sequel/transaction_spec.rb
deleted file mode 100644
index 3141d04..0000000
--- a/spec/database_cleaner/sequel/transaction_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'database_cleaner/sequel/transaction'
-require 'database_cleaner/spec'
-require 'support/sequel_helper'
-
-module DatabaseCleaner
- module Sequel
- RSpec.describe Transaction do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic transaction strategy"
-
- describe "start" do
- it "should start a transaction"
- end
-
- describe "clean" do
- it "should finish a transaction"
- end
- end
- end
-end
diff --git a/spec/database_cleaner/sequel/truncation_spec.rb b/spec/database_cleaner/sequel/truncation_spec.rb
deleted file mode 100644
index 52166cb..0000000
--- a/spec/database_cleaner/sequel/truncation_spec.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-require 'database_cleaner/sequel/truncation'
-require 'database_cleaner/spec'
-require 'support/sequel_helper'
-
-module DatabaseCleaner
- module Sequel
- RSpec.describe Truncation do
- it_should_behave_like "a generic strategy"
- it_should_behave_like "a generic truncation strategy"
-
- SequelHelper.with_all_dbs do |helper|
- context "using a #{helper.db} connection" do
- around do |example|
- helper.setup
- example.run
- helper.teardown
- end
-
- let(:connection) { helper.connection }
-
- before { subject.db = connection }
-
- context 'when several tables have data' do
- before do
- connection[:users].insert
- connection[:agents].insert
- end
-
- context 'by default' do
- it 'truncates all the tables' do
- subject.clean
-
- expect(connection[:users]).to be_empty
- expect(connection[:agents]).to be_empty
- end
- end
-
- context 'restricted to "only: [...]" some tables' do
- subject { described_class.new(only: ['users']) }
-
- it 'truncates only the mentioned tables (and leaves the rest alone)' do
- subject.clean
-
- expect(connection[:users]).to be_empty
- expect(connection[:agents].count).to eq(1)
- end
- end
-
- context 'restricted to "except: [...]" some tables' do
- subject { described_class.new(except: ['users']) } # XXX: Strings only, symbols are ignored
-
- it 'leaves the mentioned tables alone (and truncates the rest)' do
- subject.clean
-
- expect(connection[:users].count).to eq(1)
- expect(connection[:agents]).to be_empty
- end
- end
- end
-
- describe 'auto increment sequences' do
- it "resets AUTO_INCREMENT primary key seqeunce" do
- table = connection[:users]
- 2.times { table.insert }
-
- subject.clean
-
- id_after_clean = table.insert
- expect(id_after_clean).to eq 1
- end
- end
-
- describe "with pre_count optimization option" do
- subject { described_class.new(pre_count: true) }
-
- before { connection[:users].insert }
-
- it "only truncates non-empty tables" do
- sql = case helper.db
- when :sqlite3 then ["DELETE FROM `users`", anything]
- when :postgres then ['TRUNCATE TABLE "users" RESTART IDENTITY;', anything]
- else ["TRUNCATE TABLE `users`", anything]
- end
- expect(subject.db).to receive(:execute_ddl).once.with(*sql)
- subject.clean
- end
- end
- end
- end
- end
- end
-end