Sha256: 1bfa58d2231350b6138f567cc197a2872c3e760522918d8e7cee4529dae05888

Contents?: true

Size: 804 Bytes

Versions: 11

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Hanami, ".env" do
  subject { described_class.env(e: env) }

  context "HANAMI_ENV in ENV" do
    let(:env) { {"HANAMI_ENV" => "test"} }

    it "is the value of HANAMI_ENV" do
      is_expected.to eq(:test)
    end
  end

  context "RACK_ENV in ENV" do
    let(:env) { {"HANAMI_ENV" => "test"} }

    it "is the value of RACK_ENV" do
      is_expected.to eq(:test)
    end
  end

  context "both HANAMI_ENV and RACK_ENV in ENV" do
    let(:env) do
      {"HANAMI_ENV" => "test",
       "RACK_ENV" => "production"}
    end

    it "is the value of HANAMI_ENV" do
      is_expected.to eq(:test)
    end
  end

  context "no ENV vars set" do
    let(:env) { {} }

    it "defaults to \"development\"" do
      is_expected.to eq(:development)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hanami-2.2.1 spec/unit/hanami/env_spec.rb
hanami-2.2.0 spec/unit/hanami/env_spec.rb
hanami-2.2.0.rc1 spec/unit/hanami/env_spec.rb
hanami-2.2.0.beta2 spec/unit/hanami/env_spec.rb
hanami-2.2.0.beta1 spec/unit/hanami/env_spec.rb
hanami-2.1.0 spec/unit/hanami/env_spec.rb
hanami-2.1.0.rc3 spec/unit/hanami/env_spec.rb
hanami-2.1.0.rc2 spec/unit/hanami/env_spec.rb
hanami-2.1.0.rc1 spec/unit/hanami/env_spec.rb
hanami-2.1.0.beta2.1 spec/unit/hanami/env_spec.rb
hanami-2.1.0.beta2 spec/unit/hanami/env_spec.rb