diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-27 00:01:46 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-12-26 15:28:38 +0000 |
commit | a968d783a3dbd3585b6285c5c9c9ef11bd36b6f4 (patch) | |
tree | 597485701b92c2e14ef0127c5abab2e5d17b8fa2 /test/irb/test_color_printer.rb | |
parent | d93d786338b3dca54595a6619f433607a834816a (diff) | |
download | ruby-a968d783a3dbd3585b6285c5c9c9ef11bd36b6f4.tar.gz |
[ruby/irb] Test colors with enabling colors
https://github.com/ruby/irb/commit/998b7a74fa
Diffstat (limited to 'test/irb/test_color_printer.rb')
-rw-r--r-- | test/irb/test_color_printer.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/irb/test_color_printer.rb b/test/irb/test_color_printer.rb index 79ab050550..41a7345bd3 100644 --- a/test/irb/test_color_printer.rb +++ b/test/irb/test_color_printer.rb @@ -15,6 +15,10 @@ module TestIRB CYAN = "\e[36m" def setup + super + if IRB.respond_to?(:conf) + @colorize, IRB.conf[:USE_COLORIZE] = IRB.conf[:USE_COLORIZE], true + end @get_screen_size = Reline.method(:get_screen_size) Reline.instance_eval { undef :get_screen_size } def Reline.get_screen_size @@ -25,6 +29,10 @@ module TestIRB def teardown Reline.instance_eval { undef :get_screen_size } Reline.define_singleton_method(:get_screen_size, @get_screen_size) + if instance_variable_defined?(:@colorize) + IRB.conf[:USE_COLORIZE] = @colorize + end + super end IRBTestColorPrinter = Struct.new(:a) |