lib/schema_dev/rspec/db.rb in schema_dev-3.0.1 vs lib/schema_dev/rspec/db.rb in schema_dev-3.1.0

- old
+ new

@@ -28,38 +28,43 @@ def logroot @logroot ||= Pathname.new('log').tap { |path| path.mkpath } end + def database + @database ||= "schema_plus_test" + # @database ||= (Dir["*.gemspec"].first || "schema_dev_test").sub(/\.gemspec$/, '') + "_test" + end + def configuration case @db when 'mysql' { :adapter => 'mysql', - :database => 'schema_plus_test', + :database => database, :username => ENV.fetch('MYSQL_DB_USER', 'schema_plus'), :encoding => 'utf8', :min_messages => 'warning' } when 'mysql2' { :adapter => 'mysql2', - :database => 'schema_plus_test', + :database => database, :username => ENV.fetch('MYSQL_DB_USER', 'schema_plus'), :encoding => 'utf8', :min_messages => 'warning' } when 'postgresql' { :adapter => 'postgresql', :username => ENV['POSTGRESQL_DB_USER'], - :database => 'schema_plus_test', + :database => database, :min_messages => 'warning' } when 'sqlite3' { :adapter => 'sqlite3', - :database => tmproot.join('schema_plus.sqlite3').to_s + :database => tmproot.join("#{database}.sqlite3").to_s } else raise "Unknown db adapter #{@db.inspect}" end end