test/helper.rb in swift-0.7.2 vs test/helper.rb in swift-0.8.0
- old
+ new
@@ -3,25 +3,24 @@
require 'minitest/spec'
require 'minitest/unit'
require 'swift'
require 'etc'
-# db2 database name is limited to 8 characters, gonna use swift instead of swift_test
-
class MiniTest::Spec
def self.supported_by *adapters, &block
- connection_defaults = { db: 'swift', user: Etc.getlogin, host: '127.0.0.1' }
+ adapter_defaults = { Swift::DB::Sqlite3 => { db: ':memory:' } }
+ connection_defaults = { db: 'swift_test', user: Etc.getlogin, host: '127.0.0.1' }
adapters.each do |adapter|
begin
- Swift.setup :default, adapter, connection_defaults
+ Swift.setup :default, adapter, connection_defaults.merge(adapter_defaults.fetch(adapter, {}))
rescue => error
- warn "Unable to setup 'swift' db for #{adapter}, #{error.message}. Skipping..."
+ warn "Unable to setup 'swift_test' db for #{adapter}, #{error.message}. Skipping..."
next
end
describe("Adapter #{adapter.name}") do
before do
- Swift.setup :default, adapter, connection_defaults
+ Swift.setup :default, adapter, connection_defaults.merge(adapter_defaults.fetch(adapter, {}))
end
block.call(adapter)
end
end
end