summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_kernel.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rubygems/test_kernel.rb b/test/rubygems/test_kernel.rb
index b9f9b5e254..daf9b57d7c 100644
--- a/test/rubygems/test_kernel.rb
+++ b/test/rubygems/test_kernel.rb
@@ -91,6 +91,25 @@ class TestKernel < Gem::TestCase
refute $:.any? { |p| %r{a-1/bin} =~ p }
end
+ def test_gem_failing_inside_require_doesnt_cause_double_exceptions
+ File.write("activate.rb", "gem('a', '= 999')\n")
+
+ require "open3"
+
+ output, _ = Open3.capture2e(
+ { "GEM_HOME" => Gem.paths.home },
+ Gem.ruby,
+ "-I",
+ File.expand_path("../../lib", __dir__),
+ "-r",
+ "./activate.rb"
+ )
+
+ load_errors = output.split("\n").select { |line| line.include?("Could not find")}
+
+ assert_equal 1, load_errors.size
+ end
+
def test_gem_bundler
quick_gem 'bundler', '1'
quick_gem 'bundler', '2.a'