# frozen_string_literal: true RSpec.describe "DB / Provider", :app_integration do before do @env = ENV.to_h allow(Hanami::Env).to receive(:loaded?).and_return(false) end after do ENV.replace(@env) end it "is registered when only a config/db/ dir exists" do with_tmp_directory(Dir.mktmpdir) do write "config/app.rb", <<~RUBY require "hanami" module TestApp class App < Hanami::App end end RUBY write "config/db/.keep", "" ENV["DATABASE_URL"] = "sqlite::memory" require "hanami/prepare" Hanami.app.prepare :db expect(Hanami.app["db.gateway"]).to be end end end