aboutsummaryrefslogtreecommitdiffstats
path: root/test/irb/test_color.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-04-27 22:01:10 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-04-27 22:01:11 +0900
commit9348643575d7a744f3e404d9069a0d29f97960a0 (patch)
tree67bf06991e296298aed64d544effddc3e48148ea /test/irb/test_color.rb
parent3f9562015e651735bfc2fdd14e8f6963b673e22a (diff)
downloadruby-9348643575d7a744f3e404d9069a0d29f97960a0.tar.gz
make sync-default-gems GEM=irb
Synced from https://github.com/ruby/irb/commit/5feb361ed80736efa5b2c2b629837ec2a5fc2cdb. This includes a support to colorize named Class instance on IRB inspect.
Diffstat (limited to 'test/irb/test_color.rb')
-rw-r--r--test/irb/test_color.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index 8439fd54f5..8a59374691 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -30,7 +30,7 @@ module TestIRB
"# comment" => "#{BLUE}#{BOLD}# comment#{CLEAR}",
"yield(hello)" => "#{GREEN}yield#{CLEAR}(hello)",
}.each do |code, result|
- assert_equal(result, with_term { IRB::Color.colorize_code(code) })
+ assert_equal(result, with_term { IRB::Color.colorize_code(code) }, "Case: colorize_code(#{code.dump})")
end
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6.0')
@@ -54,10 +54,11 @@ module TestIRB
{ a: 4 } => true,
/reg/ => true,
Object.new => false,
+ Struct => true,
Struct.new(:a) => false,
Struct.new(:a).new(1) => false,
}.each do |object, result|
- assert_equal(result, IRB::Color.inspect_colorable?(object))
+ assert_equal(result, IRB::Color.inspect_colorable?(object), "Case: inspect_colorable?(#{object.inspect})")
end
end