summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-15 11:15:55 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-15 12:11:12 +0900
commite1978a905a32af2d48b6e9efb6d0fe1656fddc5b (patch)
tree74734fabc36c9dc99a16cb03800a0a406ddc520e
parent9cba65fd18a090036ac745085b6bd362caea04dc (diff)
Fixup da2c2931a60
-rw-r--r--test/irb/type_completion/test_type_analyze.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/irb/type_completion/test_type_analyze.rb b/test/irb/type_completion/test_type_analyze.rb
index e3547bf250..272756a243 100644
--- a/test/irb/type_completion/test_type_analyze.rb
+++ b/test/irb/type_completion/test_type_analyze.rb
@@ -445,22 +445,20 @@ module TestIRB
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)
- 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.', include: String) if defined?(IRB::VERSION)
+ assert_call('module IRB; IRB::VERSION.', include: String) if defined?(IRB::VERSION)
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)
+ assert_call('module IRB; module A; VERSION.', include: String) if defined?(IRB::VERSION)
assert_call('module IRB; module A; VERSION=1; VERSION.', include: Integer)
- assert_call('module IRB; module A; VERSION=1; IRB::VERSION.', include: String)
- assert_call('module IRB; module A; VERSION=1; end; VERSION.', include: String)
+ assert_call('module IRB; module A; VERSION=1; IRB::VERSION.', include: String) if defined?(IRB::VERSION)
+ assert_call('module IRB; module A; VERSION=1; end; VERSION.', include: String) if defined?(IRB::VERSION)
assert_call('module IRB; IRB=1; IRB.', include: Integer)
- assert_call('module IRB; IRB=1; ::IRB::VERSION.', include: String)
+ assert_call('module IRB; IRB=1; ::IRB::VERSION.', include: String) if defined?(IRB::VERSION)
module_binding = eval 'module ::IRB; binding; end'
assert_call('VERSION.', include: NilClass)
- assert_call('VERSION.', include: String, binding: module_binding)
- assert_call('IRB::VERSION.', include: String, binding: module_binding)
+ assert_call('VERSION.', include: String, binding: module_binding) if defined?(IRB::VERSION)
+ assert_call('IRB::VERSION.', include: String, binding: module_binding) if defined?(IRB::VERSION)
assert_call('A = 1; module M; A += 0.5; A.', include: Float)
assert_call('::A = 1; module M; A += 0.5; A.', include: Float)
assert_call('::A = 1; module M; A += 0.5; ::A.', include: Integer)