summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-28 18:30:20 +0900
committergit <svn-admin@ruby-lang.org>2022-10-28 09:30:24 +0000
commit56c97a6621241db99f7c96740164bdd8f898d881 (patch)
treef308631bbdf724b1dd30b9fd6c2538e21265af39 /test
parent13e968c1cdd2da470173e2cc15b44ebb936be534 (diff)
[ruby/irb] Update regarding NO_COLOR value
https://no-color.org has been updated (jcs/no_color#83): > Command-line software which adds ANSI color to its output by default should check for a `NO_COLOR` environment variable that, when present and **not an empty string** (regardless of its value), prevents the addition of ANSI color. https://github.com/ruby/irb/commit/46e0f7e370 Co-authored-by: Stan Lo <stan001212@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_init.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/irb/test_init.rb b/test/irb/test_init.rb
index 3293b98d34..074aae4070 100644
--- a/test/irb/test_init.rb
+++ b/test/irb/test_init.rb
@@ -80,6 +80,10 @@ module TestIRB
IRB.setup(__FILE__)
refute IRB.conf[:USE_COLORIZE]
+ ENV['NO_COLOR'] = ''
+ IRB.setup(__FILE__)
+ assert IRB.conf[:USE_COLORIZE]
+
ENV['NO_COLOR'] = nil
IRB.setup(__FILE__)
assert IRB.conf[:USE_COLORIZE]