diff options
Diffstat (limited to 'test/irb/test_color.rb')
-rw-r--r-- | test/irb/test_color.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 1b27afb898..ca4ae4b8f9 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -18,6 +18,20 @@ module TestIRB MAGENTA = "\e[35m" CYAN = "\e[36m" + def setup + super + if IRB.respond_to?(:conf) + @colorize, IRB.conf[:USE_COLORIZE] = IRB.conf[:USE_COLORIZE], true + end + end + + def teardown + if instance_variable_defined?(:@colorize) + IRB.conf[:USE_COLORIZE] = @colorize + end + super + end + def test_colorize text = "text" { |