Sha256: 4cf8d7cd1cb0b409c622d56bc81fe4c5bc35c56bdf62841c44d0b32b0f9a8a69

Contents?: true

Size: 686 Bytes

Versions: 5

Compression:

Stored size: 686 Bytes

Contents

# 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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-2.2.1 spec/integration/db/provider_spec.rb
hanami-2.2.0 spec/integration/db/provider_spec.rb
hanami-2.2.0.rc1 spec/integration/db/provider_spec.rb
hanami-2.2.0.beta2 spec/integration/db/provider_spec.rb
hanami-2.2.0.beta1 spec/integration/db/provider_spec.rb