Commit 83d2622
committed
Use conditional hooks for money precision
Move the `Money.default_infinite_precision` test setup from a shared
context into global, conditional RSpec hooks.
The previous `shared_context` approach, which relied on implicit
metadata inclusion, is deprecated and was failing with the modern
`shared_context_metadata_behavior = :apply_to_host_groups` setting.
An explicit `include_context` is unsuitable because this behavior is
sometimes required for individual examples (`it` blocks), where
contexts cannot be included.
This commit defines global `before` and `after` hooks in the RSpec
configuration that are filtered by the
`:default_infinite_precision_true` metadata tag. This provides a
declarative and efficient way to apply the necessary setup and teardown
to any example group or individual example without repetitive code,
while aligning with modern RSpec practices.
Close #11361 parent 5dd51d0 commit 83d2622
1 file changed
+7
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 114 | | |
121 | | - | |
122 | | - | |
| 115 | + | |
123 | 116 | | |
124 | 117 | | |
125 | 118 | | |
126 | | - | |
| 119 | + | |
127 | 120 | | |
128 | 121 | | |
129 | 122 | | |
130 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
| |||
0 commit comments