|
24 | 24 | end |
25 | 25 |
|
26 | 26 | it "returns validated configuration with minimal fields" do |
27 | | - config = { handler_plugin_dir: "/path/to/handlers" } |
| 27 | + config = { |
| 28 | + handler_plugin_dir: "/path/to/handlers", |
| 29 | + log_level: "info", |
| 30 | + root_path: "/app", |
| 31 | + environment: "development" |
| 32 | + } |
28 | 33 |
|
29 | 34 | result = described_class.validate_global_config(config) |
30 | 35 |
|
31 | | - expect(result).to eq({ handler_plugin_dir: "/path/to/handlers" }) |
| 36 | + expect(result).to eq(config) |
32 | 37 | end |
33 | 38 |
|
34 | 39 | it "accepts production environment" do |
35 | 40 | config = { |
36 | 41 | environment: "production", |
37 | | - handler_plugin_dir: "/path/to/handlers" |
| 42 | + handler_plugin_dir: "/path/to/handlers", |
| 43 | + log_level: "info", |
| 44 | + root_path: "/app" |
38 | 45 | } |
39 | 46 |
|
40 | 47 | result = described_class.validate_global_config(config) |
|
46 | 53 | %w[debug info warn error].each do |log_level| |
47 | 54 | config = { |
48 | 55 | log_level: log_level, |
49 | | - handler_plugin_dir: "/path/to/handlers" |
| 56 | + handler_plugin_dir: "/path/to/handlers", |
| 57 | + root_path: "/app", |
| 58 | + environment: "development" |
50 | 59 | } |
51 | 60 |
|
52 | 61 | result = described_class.validate_global_config(config) |
|
121 | 130 | config = { |
122 | 131 | use_catchall_route: "true", |
123 | 132 | normalize_headers: "1", |
124 | | - handler_plugin_dir: "/path/to/handlers" |
| 133 | + handler_plugin_dir: "/path/to/handlers", |
| 134 | + log_level: "info", |
| 135 | + root_path: "/app", |
| 136 | + environment: "development" |
125 | 137 | } |
126 | 138 |
|
127 | 139 | result = described_class.validate_global_config(config) |
|
146 | 158 | config = { |
147 | 159 | request_limit: "1024", |
148 | 160 | request_timeout: "30", |
149 | | - handler_plugin_dir: "/path/to/handlers" |
| 161 | + handler_plugin_dir: "/path/to/handlers", |
| 162 | + log_level: "info", |
| 163 | + root_path: "/app", |
| 164 | + environment: "development" |
150 | 165 | } |
151 | 166 |
|
152 | 167 | result = described_class.validate_global_config(config) |
|
174 | 189 | it "coerces float values to integers by truncating" do |
175 | 190 | config = { |
176 | 191 | request_timeout: 30.5, |
177 | | - handler_plugin_dir: "/path/to/handlers" |
| 192 | + handler_plugin_dir: "/path/to/handlers", |
| 193 | + log_level: "info", |
| 194 | + root_path: "/app", |
| 195 | + environment: "development" |
178 | 196 | } |
179 | 197 |
|
180 | 198 | result = described_class.validate_global_config(config) |
|
0 commit comments