summaryrefslogtreecommitdiff
path: root/test/ruby/box
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-12-16 09:01:14 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2025-12-16 16:53:13 +0900
commit85b40c5ea8f606cf34cab8a5b1277033bede2457 (patch)
tree4d12e01f2ec1a1ba17f558e056312f9533a59fea /test/ruby/box
parent5f09e1f046599c5466787449f5d30330d4dd4aab (diff)
Box: fix the class name in tests
Diffstat (limited to 'test/ruby/box')
-rw-r--r--test/ruby/box/a.1_1_0.rb4
-rw-r--r--test/ruby/box/a.1_2_0.rb4
-rw-r--r--test/ruby/box/a.rb4
-rw-r--r--test/ruby/box/autoloading.rb6
-rw-r--r--test/ruby/box/box.rb10
-rw-r--r--test/ruby/box/consts.rb1
-rw-r--r--test/ruby/box/current.rb13
-rw-r--r--test/ruby/box/global_vars.rb8
-rw-r--r--test/ruby/box/ns.rb10
-rw-r--r--test/ruby/box/procs.rb2
10 files changed, 25 insertions, 37 deletions
diff --git a/test/ruby/box/a.1_1_0.rb b/test/ruby/box/a.1_1_0.rb
index bf64dbaa62..0322585097 100644
--- a/test/ruby/box/a.1_1_0.rb
+++ b/test/ruby/box/a.1_1_0.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-class NS_A
+class BOX_A
VERSION = "1.1.0"
def yay
@@ -8,7 +8,7 @@ class NS_A
end
end
-module NS_B
+module BOX_B
VERSION = "1.1.0"
def self.yay
diff --git a/test/ruby/box/a.1_2_0.rb b/test/ruby/box/a.1_2_0.rb
index 6d25c0885d..29813ea57b 100644
--- a/test/ruby/box/a.1_2_0.rb
+++ b/test/ruby/box/a.1_2_0.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-class NS_A
+class BOX_A
VERSION = "1.2.0"
def yay
@@ -8,7 +8,7 @@ class NS_A
end
end
-module NS_B
+module BOX_B
VERSION = "1.2.0"
def self.yay
diff --git a/test/ruby/box/a.rb b/test/ruby/box/a.rb
index a6dcd9cd21..26a622c92b 100644
--- a/test/ruby/box/a.rb
+++ b/test/ruby/box/a.rb
@@ -1,4 +1,4 @@
-class NS_A
+class BOX_A
FOO = "foo_a1"
def yay
@@ -6,7 +6,7 @@ class NS_A
end
end
-module NS_B
+module BOX_B
BAR = "bar_b1"
def self.yay
diff --git a/test/ruby/box/autoloading.rb b/test/ruby/box/autoloading.rb
index 19ec00bcd5..cba57ab377 100644
--- a/test/ruby/box/autoloading.rb
+++ b/test/ruby/box/autoloading.rb
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-autoload :NS_A, File.join(__dir__, 'a.1_1_0')
-NS_A.new.yay
+autoload :BOX_A, File.join(__dir__, 'a.1_1_0')
+BOX_A.new.yay
-module NS_B
+module BOX_B
autoload :BAR, File.join(__dir__, 'a')
end
diff --git a/test/ruby/box/box.rb b/test/ruby/box/box.rb
new file mode 100644
index 0000000000..3b7da14e9d
--- /dev/null
+++ b/test/ruby/box/box.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+BOX1 = Ruby::Box.new
+BOX1.require_relative('a.1_1_0')
+
+def yay
+ BOX1::BOX_B::yay
+end
+
+yay
diff --git a/test/ruby/box/consts.rb b/test/ruby/box/consts.rb
index 44a383111b..e40cd5c50c 100644
--- a/test/ruby/box/consts.rb
+++ b/test/ruby/box/consts.rb
@@ -1,3 +1,4 @@
+$VERBOSE = nil
class String
STR_CONST1 = 111
STR_CONST2 = 222
diff --git a/test/ruby/box/current.rb b/test/ruby/box/current.rb
deleted file mode 100644
index 4af9a92ddc..0000000000
--- a/test/ruby/box/current.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-$ns_in_ns = ::Namespace.current
-
-module CurrentNamespace
- def self.in_require
- $ns_in_ns
- end
-
- def self.in_method_call
- ::Namespace.current
- end
-end
diff --git a/test/ruby/box/global_vars.rb b/test/ruby/box/global_vars.rb
index 3764eb0d19..590363f617 100644
--- a/test/ruby/box/global_vars.rb
+++ b/test/ruby/box/global_vars.rb
@@ -20,18 +20,18 @@ end
module UniqueGvar
def self.read
- $used_only_in_ns
+ $used_only_in_box
end
def self.write(val)
- $used_only_in_ns = val
+ $used_only_in_box = val
end
def self.write_only(val)
- $write_only_var_in_ns = val
+ $write_only_var_in_box = val
end
- def self.gvars_in_ns
+ def self.gvars_in_box
global_variables
end
end
diff --git a/test/ruby/box/ns.rb b/test/ruby/box/ns.rb
deleted file mode 100644
index e947e3cdc8..0000000000
--- a/test/ruby/box/ns.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-NS1 = Namespace.new
-NS1.require_relative('a.1_1_0')
-
-def yay
- NS1::NS_B::yay
-end
-
-yay
diff --git a/test/ruby/box/procs.rb b/test/ruby/box/procs.rb
index a7fe58ceb6..1c39a8231b 100644
--- a/test/ruby/box/procs.rb
+++ b/test/ruby/box/procs.rb
@@ -11,7 +11,7 @@ module ProcLookupTestA
end
end
-module ProcInNS
+module ProcInBox
def self.make_proc_from_block(&b)
b
end