Repository navigation
Commit ec20997
test: don't override
GitHub: fix GH-70
`Fake::HTTP.new` used `Class.method(:new).unbind.bind(self)` to bypass
`Net::HTTP.new`. It fails with Ruby 4.1 because `Class.method(:new)` is
a singleton method of `Class` now:
```text
TypeError: singleton method called for a different object
```
We don't need to bypass `Net::HTTP.new`. We can use the default
`Net::HTTP#initialize` and set responses by an attribute writer instead.
Reported by Mamoru TASAKA. Thanks!!!
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>Fake::HTTP.new (#72)1 parent dd451e0 commit ec20997
1 file changed
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 17 | + | |
28 | 18 | | |
29 | 19 | | |
30 | 20 | | |
| |||
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
60 | | - | |
| 50 | + | |
61 | 51 | | |
62 | 52 | | |
63 | 53 | | |
| |||
353 | 343 | | |
354 | 344 | | |
355 | 345 | | |
356 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
357 | 351 | | |
358 | 352 | | |
359 | 353 | | |
| |||
0 commit comments