Browse Source

Fix a minor oversight in "ruby-standard-libs"

We should always remove "mathn" if our effective Ruby version is 2.5+.

See https://github.com/docker-library/official-images/pull/4392
Tianon Gravi 7 years ago
parent
commit
db5d5eadb9
1 changed files with 5 additions and 5 deletions
  1. 5 5
      test/tests/ruby-standard-libs/container.rb

+ 5 - 5
test/tests/ruby-standard-libs/container.rb

@@ -103,11 +103,11 @@ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
 	stdlib.delete('mkmf')
 	stdlib.delete('objspace')
 	stdlib.delete('sdbm')
-else
-	require 'rubygems/version'
-	if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.5')
-		stdlib.delete('mathn')
-	end
+end
+
+require 'rubygems/version'
+if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.5')
+	stdlib.delete('mathn')
 end
 
 result = 'ok'