From da2c2931a602da22bc1fd10dc41f5c3a117bf502 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 15 Nov 2023 10:34:22 +0900 Subject: [PATCH] Skip Type completion tests related with IRB::VERSION --- test/irb/type_completion/test_type_analyze.rb | 6 ++++-- test/irb/type_completion/test_type_completor.rb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/irb/type_completion/test_type_analyze.rb b/test/irb/type_completion/test_type_analyze.rb index c417a8ad120719..e3547bf25060b3 100644 --- a/test/irb/type_completion/test_type_analyze.rb +++ b/test/irb/type_completion/test_type_analyze.rb @@ -445,8 +445,10 @@ def test_constant_path assert_call('class A; X=1; class B; X=""; X.', include: String, exclude: Integer) assert_call('class A; X=1; class B; X=""; end; X.', include: Integer, exclude: String) assert_call('class A; class B; X=1; end; end; class A; class B; X.', include: Integer) - assert_call('module IRB; VERSION.', include: String) - assert_call('module IRB; IRB::VERSION.', include: String) + if defined?(IRB::VERSION) + assert_call('module IRB; VERSION.', include: String) + assert_call('module IRB; IRB::VERSION.', include: String) + end assert_call('module IRB; VERSION=1; VERSION.', include: Integer) assert_call('module IRB; VERSION=1; IRB::VERSION.', include: Integer) assert_call('module IRB; module A; VERSION.', include: String) diff --git a/test/irb/type_completion/test_type_completor.rb b/test/irb/type_completion/test_type_completor.rb index eed400b3e2d6f6..90477f8f9100a1 100644 --- a/test/irb/type_completion/test_type_completor.rb +++ b/test/irb/type_completion/test_type_completor.rb @@ -89,7 +89,7 @@ def test_lvar def test_const assert_completion('Ar', include: 'Array') assert_completion('::Ar', include: 'Array') - assert_completion('IRB::V', include: 'VERSION') + assert_completion('IRB::V', include: 'VERSION') if defined?(IRB::VERSION) assert_completion('FooBar=1; F', include: 'FooBar') assert_completion('::FooBar=1; ::F', include: 'FooBar') assert_doc_namespace('Array', 'Array')