File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11class Shakapacker ::Env
2+ FALLBACK_ENV = "production" . freeze
3+
24 delegate :config_path , :logger , to : :@instance
35
46 def self . inquire ( instance )
@@ -11,7 +13,7 @@ def initialize(instance)
1113
1214 def inquire
1315 fallback_env_warning if config_path . exist? && !current
14- current || Shakapacker :: DEFAULT_ENV . inquiry
16+ current || FALLBACK_ENV . inquiry
1517 end
1618
1719 private
@@ -20,7 +22,7 @@ def current
2022 end
2123
2224 def fallback_env_warning
23- logger . info "RAILS_ENV=#{ Rails . env } environment is not defined in #{ config_path } , falling back to #{ Shakapacker :: DEFAULT_ENV } environment"
25+ logger . info "RAILS_ENV=#{ Rails . env } environment is not defined in #{ config_path } , falling back to #{ FALLBACK_ENV } environment"
2426 end
2527
2628 def available_environments
Original file line number Diff line number Diff line change 55 expect ( Shakapacker . env ) . to eq Rails . env
66 end
77
8- it "uses development env without config" do
8+ it "uses production env when config for current env is missing " do
99 with_rails_env ( "foo" ) do
10- expect ( Shakapacker . env ) . to eq "development "
10+ expect ( Shakapacker . env ) . to eq "production "
1111 end
1212 end
1313
You can’t perform that action at this time.
0 commit comments