summaryrefslogtreecommitdiff
path: root/test/mkmf
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-12 00:09:04 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-13 18:44:22 +0900
commitc2a6295ec04a191c689d22254ac1ad5d665e27ad (patch)
tree1dce4c3ba264357c4f4b0f0747236d2b88a37aca /test/mkmf
parentd99d96cc6d139b9496fa33b81d378481a8c6388b (diff)
downloadruby-c2a6295ec04a191c689d22254ac1ad5d665e27ad.tar.gz
Make the mkmf methods private in the global [Bug #16896]
Diffstat (limited to 'test/mkmf')
-rw-r--r--test/mkmf/test_mkmf.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mkmf/test_mkmf.rb b/test/mkmf/test_mkmf.rb
new file mode 100644
index 0000000000..adb86eca8d
--- /dev/null
+++ b/test/mkmf/test_mkmf.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: false
+require 'test/unit'
+require 'mkmf'
+
+class TestMkmf < Test::Unit::TestCase
+ class TestGlobal < TestMkmf
+ main = TOPLEVEL_BINDING.receiver
+ MakeMakefile.public_instance_methods(false).each do |m|
+ define_method(:"test_global_#{m}") do
+ assert_respond_to(main, [m, true])
+ assert_not_respond_to(main, [m, false])
+ end
+ end
+ end
+end