|
13 | 13 |
|
14 | 14 | describe "Kernel#sprintf" do |
15 | 15 | it_behaves_like :kernel_sprintf, -> format, *args { |
16 | | - sprintf(format, *args) |
| 16 | + r = nil |
| 17 | + -> { |
| 18 | + r = sprintf(format, *args) |
| 19 | + }.should_not complain(verbose: true) |
| 20 | + r |
17 | 21 | } |
18 | 22 |
|
19 | 23 | it_behaves_like :kernel_sprintf_encoding, -> format, *args { |
20 | | - sprintf(format, *args) |
| 24 | + r = nil |
| 25 | + -> { |
| 26 | + r = sprintf(format, *args) |
| 27 | + }.should_not complain(verbose: true) |
| 28 | + r |
21 | 29 | } |
22 | 30 |
|
23 | 31 | it_behaves_like :kernel_sprintf_to_str, -> format, *args { |
24 | | - sprintf(format, *args) |
| 32 | + r = nil |
| 33 | + -> { |
| 34 | + r = sprintf(format, *args) |
| 35 | + }.should_not complain(verbose: true) |
| 36 | + r |
25 | 37 | } |
26 | 38 | end |
27 | 39 |
|
28 | 40 | describe "Kernel.sprintf" do |
29 | 41 | it_behaves_like :kernel_sprintf, -> format, *args { |
30 | | - Kernel.sprintf(format, *args) |
| 42 | + r = nil |
| 43 | + -> { |
| 44 | + r = Kernel.sprintf(format, *args) |
| 45 | + }.should_not complain(verbose: true) |
| 46 | + r |
31 | 47 | } |
32 | 48 |
|
33 | 49 | it_behaves_like :kernel_sprintf_encoding, -> format, *args { |
34 | | - Kernel.sprintf(format, *args) |
| 50 | + r = nil |
| 51 | + -> { |
| 52 | + r = Kernel.sprintf(format, *args) |
| 53 | + }.should_not complain(verbose: true) |
| 54 | + r |
35 | 55 | } |
36 | 56 |
|
37 | 57 | it_behaves_like :kernel_sprintf_to_str, -> format, *args { |
38 | | - Kernel.sprintf(format, *args) |
| 58 | + r = nil |
| 59 | + -> { |
| 60 | + r = Kernel.sprintf(format, *args) |
| 61 | + }.should_not complain(verbose: true) |
| 62 | + r |
39 | 63 | } |
40 | 64 | end |
0 commit comments