diff --git a/spec/database_cleaner/sequel/deletion_spec.rb b/spec/database_cleaner/sequel/deletion_spec.rb index bbca31e..bb3fc39 100644 --- a/spec/database_cleaner/sequel/deletion_spec.rb +++ b/spec/database_cleaner/sequel/deletion_spec.rb @@ -1,9 +1,6 @@ require 'database_cleaner/sequel/deletion' require 'database_cleaner/shared_strategy' -require 'sequel' -require 'support/sequel/sequel_setup' -# XXX: use ActiveRecord's db_config (`db/config.yml`) for CI/dev convenience -require 'support/active_record/database_setup' +require 'support/sequel/sequel_helper' module DatabaseCleaner module Sequel diff --git a/spec/database_cleaner/sequel/transaction_spec.rb b/spec/database_cleaner/sequel/transaction_spec.rb index f24856c..73b1f74 100644 --- a/spec/database_cleaner/sequel/transaction_spec.rb +++ b/spec/database_cleaner/sequel/transaction_spec.rb @@ -1,6 +1,6 @@ require 'database_cleaner/sequel/transaction' require 'database_cleaner/shared_strategy' -require 'sequel' +require 'support/sequel/sequel_helper' module DatabaseCleaner module Sequel diff --git a/spec/database_cleaner/sequel/truncation_spec.rb b/spec/database_cleaner/sequel/truncation_spec.rb index e5f8a54..961c757 100644 --- a/spec/database_cleaner/sequel/truncation_spec.rb +++ b/spec/database_cleaner/sequel/truncation_spec.rb @@ -1,9 +1,6 @@ require 'database_cleaner/sequel/truncation' require 'database_cleaner/shared_strategy' -require 'sequel' -require 'support/sequel/sequel_setup' -# XXX: use ActiveRecord's db_config (`db/config.yml`) for CI/dev convenience -require 'support/active_record/database_setup' +require 'support/sequel/sequel_helper' module DatabaseCleaner module Sequel diff --git a/spec/support/active_record/database_setup.rb b/spec/support/active_record/database_setup.rb deleted file mode 100644 index 25081b5..0000000 --- a/spec/support/active_record/database_setup.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'yaml' - -def db_config - config_path = 'db/config.yml' - @db_config ||= YAML.load(IO.read(config_path)) -end diff --git a/spec/support/sequel/sequel_setup.rb b/spec/support/sequel/sequel_helper.rb similarity index 90% rename from spec/support/sequel/sequel_setup.rb rename to spec/support/sequel/sequel_helper.rb index 3694252..de9e13b 100644 --- a/spec/support/sequel/sequel_setup.rb +++ b/spec/support/sequel/sequel_helper.rb @@ -1,3 +1,11 @@ +require 'sequel' +require 'yaml' + +def db_config + config_path = 'db/config.yml' + @db_config ||= YAML.load(IO.read(config_path)) +end + class SequelHelper < Struct.new(:config) def setup if config[:url] == "postgres:///" || config[:url] == "sqlite:///"