Sha256: 94923cb6ad53a89ab44230fbbd71757344c44600e7527e7edb996a8b5bf463d0
Contents?: true
Size: 835 Bytes
Versions: 18
Compression:
Stored size: 835 Bytes
Contents
# frozen_string_literal: true require "dry/inflector" require "hanami/config" require "hanami/slice_name" RSpec.describe Hanami::Config, "#slices" do subject(:config) { described_class.new(app_name: app_name, env: :development) } let(:app_name) { Hanami::SliceName.new(double(name: "MyApp::App"), inflector: Dry::Inflector.new) } subject(:slices) { config.slices } before do @orig_env = ENV.to_h end after do ENV.replace(@orig_env) end it "is nil by default" do is_expected.to be nil end it "defaults to the HANAMI_LOAD_SLICES env var, separated by commas" do ENV["HANAMI_SLICES"] = "main,admin" is_expected.to eq %w[main admin] end it "strips spaces from HANAMI_LOAD_SLICES env var entries" do ENV["HANAMI_SLICES"] = "main, admin" is_expected.to eq %w[main admin] end end
Version data entries
18 entries across 18 versions & 1 rubygems