consider all sqlite DATABASE_URLs local.

This commit is contained in:
Micah Geisel 2018-04-21 21:55:17 -07:00
parent 8e34c1e652
commit 7519d43810
2 changed files with 9 additions and 1 deletions

View file

@ -15,7 +15,7 @@ module DatabaseCleaner
end
class RemoteDatabaseUrl
LOCAL = %w(localhost 127.0.0.1)
LOCAL = %w(localhost 127.0.0.1 sqlite3:)
def run
raise Error::RemoteDatabaseUrl if !skip? && given?

View file

@ -36,6 +36,14 @@ module DatabaseCleaner
end
end
describe 'to a sqlite db' do
let(:database_url) { 'sqlite3:tmp/db.sqlite3' }
it 'does not raise' do
expect { cleaner.start }.to_not raise_error
end
end
describe 'DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL is set' do
let(:database_url) { 'postgres://remote.host' }
before { stub_const('ENV', 'DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL' => true) }