diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-03 18:56:24 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-03 18:56:24 +0200 |
| commit | 76647606589f1f5d370a1b0add2b1b8e52dc82ea (patch) | |
| tree | e7cc041098b4a4fbd6d9e4e20bbd90c21308e95b /test/support/capture_warnings.rb | |
| parent | aaf88bd98054b1823ba0ade4b883b84e41b5e947 (diff) | |
| download | caxlsx-76647606589f1f5d370a1b0add2b1b8e52dc82ea.tar.gz caxlsx-76647606589f1f5d370a1b0add2b1b8e52dc82ea.zip | |
Introduce RuboCop performance
Also fixes performance offences in non-production code
Diffstat (limited to 'test/support/capture_warnings.rb')
| -rw-r--r-- | test/support/capture_warnings.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/support/capture_warnings.rb b/test/support/capture_warnings.rb index 60d4f24d..c327a145 100644 --- a/test/support/capture_warnings.rb +++ b/test/support/capture_warnings.rb @@ -1,5 +1,5 @@ module CaptureWarnings - def capture_warnings(&block) + def capture_warnings # Turn off warnings with setting $VERBOSE to nil original_verbose = $VERBOSE $VERBOSE = nil @@ -8,7 +8,7 @@ module CaptureWarnings original_warn = Kernel.instance_method(:warn) warnings = [] Kernel.send(:define_method, :warn) { |string| warnings << string } - block.call + yield # Revert to the original warn method and set back $VERBOSE to previous value Kernel.send(:define_method, :warn, original_warn) |
