diff options
author | aycabta <aycabta@gmail.com> | 2021-02-08 11:08:57 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-02-11 20:31:29 +0900 |
commit | b2d2d25b94fd9699408759f5b8b394f54f57ef89 (patch) | |
tree | 24f1c358dfff388a15626444b7ce2ab2414beb88 | |
parent | d77a42fbfd60f4e4f49f1feb56e089494fbf3572 (diff) | |
download | ruby-b2d2d25b94fd9699408759f5b8b394f54f57ef89.tar.gz |
[ruby/irb] Suppress colorize on Windows tests
https://github.com/ruby/irb/commit/5be9354cf9
-rw-r--r-- | lib/irb/workspace.rb | 2 | ||||
-rw-r--r-- | test/irb/test_workspace.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/irb/workspace.rb b/lib/irb/workspace.rb index c6c328e7b5..78d434d106 100644 --- a/lib/irb/workspace.rb +++ b/lib/irb/workspace.rb @@ -175,7 +175,7 @@ EOF body = (start_pos..end_pos).map do |current_pos| sprintf(fmt, pos == current_pos ? '=>' : '', current_pos + 1, lines[current_pos]) end.join("") - "\nFrom: #{file} @ line #{pos + 1} :\n\n#{body}#{Color.clear}\n" + "\nFrom: #{file} @ line #{pos + 1} :\n\n#{body}#{Color.clear if use_colorize}\n" end def IRB.delete_caller diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb index 15c77315a8..f028fc3aa2 100644 --- a/test/irb/test_workspace.rb +++ b/test/irb/test_workspace.rb @@ -9,6 +9,7 @@ require 'irb/color' module TestIRB class TestWorkSpace < Test::Unit::TestCase def test_code_around_binding + IRB.conf[:USE_COLORIZE] = false Tempfile.create('irb') do |f| code = <<~RUBY # 1 @@ -33,6 +34,8 @@ module TestIRB EOS end + ensure + IRB.conf.delete(:USE_COLORIZE) end def test_code_around_binding_with_existing_unreadable_file @@ -52,6 +55,7 @@ module TestIRB end def test_code_around_binding_with_script_lines__ + IRB.conf[:USE_COLORIZE] = false with_script_lines do |script_lines| Tempfile.create('irb') do |f| code = "IRB::WorkSpace.new(binding)\n" @@ -67,6 +71,8 @@ module TestIRB EOS end end + ensure + IRB.conf.delete(:USE_COLORIZE) end def test_code_around_binding_on_irb |