From 6105b5f6475d8d3f9936b0444e0b5bdea58ae336 Mon Sep 17 00:00:00 2001 From: Micah Geisel Date: Sun, 5 Apr 2020 00:04:56 -0700 Subject: [PATCH] replace Configuration with Cleaners, as the former is just a wrapper, now. --- lib/database_cleaner/configuration.rb | 22 ---------------------- lib/database_cleaner/core.rb | 9 +++------ 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/lib/database_cleaner/configuration.rb b/lib/database_cleaner/configuration.rb index bce21f5..60b1eea 100644 --- a/lib/database_cleaner/configuration.rb +++ b/lib/database_cleaner/configuration.rb @@ -1,9 +1,6 @@ require 'database_cleaner/base' -require 'database_cleaner/deprecation' -require 'forwardable' module DatabaseCleaner - class Cleaners < Hash def initialize hash={} super.replace(hash) @@ -56,23 +53,4 @@ module DatabaseCleaner end) end end - - class Configuration - def initialize - @cleaners ||= Cleaners.new - end - - extend Forwardable - delegate [ - :[], - :strategy=, - :orm=, - :start, - :clean, - :cleaning, - :clean_with, - ] => :cleaners - - attr_accessor :cleaners - end end diff --git a/lib/database_cleaner/core.rb b/lib/database_cleaner/core.rb index 03e12ee..9f02ba0 100644 --- a/lib/database_cleaner/core.rb +++ b/lib/database_cleaner/core.rb @@ -8,8 +8,6 @@ module DatabaseCleaner extend Forwardable delegate [ :[], - :cleaners, - :cleaners=, :strategy=, :orm=, :start, @@ -20,10 +18,9 @@ module DatabaseCleaner attr_accessor :allow_remote_database_url, :allow_production, :url_whitelist - private - - def configuration - @configuration ||= Configuration.new + def cleaners + @cleaners ||= Cleaners.new end + attr_writer :cleaners end end