Commit c3d43a8
committed
Inflections cleanup
1. Don’t use weird instance variable names
2. Don’t reach into the internals from the test (accessing ivars)
3. Properly reset the inflection rules after each test
(1) and (2) is to establish a clear boundary to make future refactors
easier.
(3) is to fix a bug where we modify the inflection rules and don’t reset
them properly after each test. We only attempt to do that for the `:en`
locale, but we have tests that modifies other locales that doesn’t get
cleaned up properly. For better or worse, the current API for loading
the default rules is to load `inflections.rb`, so let’s just do that and
reset the rules after each test.1 parent 5f9d6f5 commit c3d43a8
File tree
3 files changed
+21
-39
lines changed- actionpack/test/controller
- activesupport
- lib/active_support/inflector
- test
3 files changed
+21
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
354 | 345 | | |
355 | 346 | | |
356 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
357 | 351 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
364 | 356 | | |
| 357 | + | |
365 | 358 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| |||
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 11 | | |
22 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
| |||
0 commit comments