summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-09-12 09:44:22 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-09-26 17:48:01 +0900
commita2af47301834ede4892dbbe1b7da28317202657e (patch)
tree1c7d0b420cc5e99a13cc28f94485ce6dece84002 /test
parent54839f01736a8827be64c7f1720d226d37fa17d3 (diff)
[rubygems/rubygems] Make sure our modifications to kernel.warn work
And test the fix we're adding. https://github.com/rubygems/rubygems/commit/6f86637b98
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_require.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb
index 38b54bdc44..d1dc994e6e 100644
--- a/test/rubygems/test_require.rb
+++ b/test/rubygems/test_require.rb
@@ -516,6 +516,21 @@ class TestGemRequire < Gem::TestCase
assert_equal "main.rb:1: warning: uplevel\ntest\n", err
end
end
+
+ def test_no_other_behavioral_changes_with_kernel_warn
+ lib = File.realpath("../../../lib", __FILE__)
+ Dir.mktmpdir("warn_test") do |dir|
+ File.write(dir + "/main.rb", "warn({x:1}, {y:2}, {})\n")
+ _, err = capture_subprocess_io do
+ system(@@ruby, "-w", "-rpp", "--disable=gems", "-I", lib, "-C", dir, "-I.", "main.rb")
+ end
+ assert_equal "{:x=>1}\n{:y=>2}\n", err
+ _, err = capture_subprocess_io do
+ system(@@ruby, "-w", "-rpp", "--enable=gems", "-I", lib, "-C", dir, "-I.", "main.rb")
+ end
+ assert_equal "{:x=>1}\n{:y=>2}\n", err
+ end
+ end
end
def silence_warnings