|
33 | 33 |
|
34 | 34 | expect(config[:log_level]).to eq("debug") |
35 | 35 | expect(config[:environment]).to eq("test") |
36 | | - expect(config[:production]).to be false # should be false when environment is test |
37 | 36 | expect(config[:handler_plugin_dir]).to eq("./plugins/handlers") # defaults should remain |
38 | 37 | end |
39 | 38 | end |
|
69 | 68 | expect(config[:log_level]).to eq("debug") |
70 | 69 | expect(config[:environment]).to eq("development") |
71 | 70 | expect(config[:request_timeout]).to eq(60) |
72 | | - expect(config[:production]).to be false |
73 | 71 | expect(config[:handler_plugin_dir]).to eq("./plugins/handlers") # defaults should remain |
74 | 72 | end |
75 | 73 | end |
|
94 | 92 | expect(config[:log_level]).to eq("warn") |
95 | 93 | expect(config[:environment]).to eq("staging") |
96 | 94 | expect(config[:endpoints_dir]).to eq("./custom/endpoints") |
97 | | - expect(config[:production]).to be false |
98 | 95 | end |
99 | 96 | end |
100 | 97 |
|
|
157 | 154 | expect(config[:environment]).to eq("development") |
158 | 155 | expect(config[:request_limit]).to eq(2_097_152) |
159 | 156 | expect(config[:request_timeout]).to eq(45) |
160 | | - expect(config[:production]).to be false |
161 | 157 | end |
162 | 158 |
|
163 | 159 | it "handles partial environment variable overrides" do |
|
167 | 163 |
|
168 | 164 | expect(config[:log_level]).to eq("warn") |
169 | 165 | expect(config[:environment]).to eq("production") # should remain default |
170 | | - expect(config[:production]).to be true |
171 | 166 | # Ensure other ENV vars are not set from previous examples in this context |
172 | 167 | expect(ENV["HOOKS_ENVIRONMENT"]).to be_nil |
173 | 168 | expect(ENV["HOOKS_REQUEST_LIMIT"]).to be_nil |
|
240 | 235 | it "sets production to true when environment is production" do |
241 | 236 | config = described_class.load(config_path: { environment: "production" }) |
242 | 237 |
|
243 | | - expect(config[:production]).to be true |
| 238 | + expect(config[:environment]).to eq("production") |
244 | 239 | end |
245 | 240 |
|
246 | 241 | it "sets production to false when environment is not production" do |
247 | 242 | ["development", "test", "staging", "custom"].each do |env| |
248 | 243 | config = described_class.load(config_path: { environment: env }) |
249 | 244 |
|
250 | | - expect(config[:production]).to be false |
| 245 | + expect(config[:environment]).to eq(env) |
251 | 246 | end |
252 | 247 | end |
253 | 248 | end |
|
0 commit comments