diff options
Diffstat (limited to 'test/irb/test_init.rb')
-rw-r--r-- | test/irb/test_init.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/irb/test_init.rb b/test/irb/test_init.rb index d57f0752bb..ade2fcb392 100644 --- a/test/irb/test_init.rb +++ b/test/irb/test_init.rb @@ -67,6 +67,22 @@ module TestIRB Process.kill("SIGKILL", status.pid) if !status.exited? && !status.stopped? && !status.signaled? end + def test_no_color_environment_variable + orig = ENV['NO_COLOR'] + + assert IRB.conf[:USE_COLORIZE] + + ENV['NO_COLOR'] = 'true' + IRB.setup(eval("__FILE__")) + refute IRB.conf[:USE_COLORIZE] + + ENV['NO_COLOR'] = nil + IRB.setup(eval("__FILE__")) + assert IRB.conf[:USE_COLORIZE] + ensure + ENV['NO_COLOR'] = orig + end + private def with_argv(argv) |