[ruby/irb] Suppress colorize on Windows tests
https://github.com/ruby/irb/commit/5be9354cf9
This commit is contained in:
parent
d77a42fbfd
commit
b2d2d25b94
@ -175,7 +175,7 @@ EOF
|
|||||||
body = (start_pos..end_pos).map do |current_pos|
|
body = (start_pos..end_pos).map do |current_pos|
|
||||||
sprintf(fmt, pos == current_pos ? '=>' : '', current_pos + 1, lines[current_pos])
|
sprintf(fmt, pos == current_pos ? '=>' : '', current_pos + 1, lines[current_pos])
|
||||||
end.join("")
|
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
|
end
|
||||||
|
|
||||||
def IRB.delete_caller
|
def IRB.delete_caller
|
||||||
|
@ -9,6 +9,7 @@ require 'irb/color'
|
|||||||
module TestIRB
|
module TestIRB
|
||||||
class TestWorkSpace < Test::Unit::TestCase
|
class TestWorkSpace < Test::Unit::TestCase
|
||||||
def test_code_around_binding
|
def test_code_around_binding
|
||||||
|
IRB.conf[:USE_COLORIZE] = false
|
||||||
Tempfile.create('irb') do |f|
|
Tempfile.create('irb') do |f|
|
||||||
code = <<~RUBY
|
code = <<~RUBY
|
||||||
# 1
|
# 1
|
||||||
@ -33,6 +34,8 @@ module TestIRB
|
|||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
IRB.conf.delete(:USE_COLORIZE)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_code_around_binding_with_existing_unreadable_file
|
def test_code_around_binding_with_existing_unreadable_file
|
||||||
@ -52,6 +55,7 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_code_around_binding_with_script_lines__
|
def test_code_around_binding_with_script_lines__
|
||||||
|
IRB.conf[:USE_COLORIZE] = false
|
||||||
with_script_lines do |script_lines|
|
with_script_lines do |script_lines|
|
||||||
Tempfile.create('irb') do |f|
|
Tempfile.create('irb') do |f|
|
||||||
code = "IRB::WorkSpace.new(binding)\n"
|
code = "IRB::WorkSpace.new(binding)\n"
|
||||||
@ -67,6 +71,8 @@ module TestIRB
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
IRB.conf.delete(:USE_COLORIZE)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_code_around_binding_on_irb
|
def test_code_around_binding_on_irb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user