Skip to content

Commit c42f121

Browse files
committed
[test] Remove old Rubygems code not needed with integrated bundler
1 parent 1e217c2 commit c42f121

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/spec/ruby/spec_helper.rb

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,9 @@ def raise_logger(level = 'WARN')
7575
end
7676

7777
def gem_install_unless_installed(name, version)
78-
found = nil
79-
begin
80-
if Gem::Specification.respond_to? :find_all
81-
all = Gem::Specification.find_all
82-
found = all.find do |spec|
83-
spec.name == name && spec.version.to_s == version
84-
end
85-
elsif Gem::Specification.respond_to? :find_by_name
86-
found = Gem::Specification.find_by_name name, version
87-
else
88-
raise Gem::LoadError unless Gem.available? name, version
89-
end
90-
rescue Gem::LoadError
91-
found = false
92-
end
93-
# NOTE: won't ever be found in RubyGems >= 2.3 likely due Bundler
94-
unless found
95-
require 'rubygems/dependency_installer'
96-
installer = Gem::DependencyInstaller.new
97-
installer.install name, version
98-
end
78+
require 'rubygems/dependency_installer'
79+
installer = Gem::DependencyInstaller.new
80+
installer.install name, version
9981
end
10082

10183
ExpectationNotMetError = RSpec::Expectations::ExpectationNotMetError

0 commit comments

Comments
 (0)