mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@4f59d86
This commit is contained in:
parent
342fbae83c
commit
148961adcd
47 changed files with 725 additions and 61 deletions
|
@ -12,7 +12,22 @@ module CodeLoadingSpecs
|
|||
end
|
||||
end
|
||||
|
||||
def self.preload_rubygems
|
||||
# Require RubyGems eagerly, to ensure #require is already the RubyGems
|
||||
# version and RubyGems is only loaded once, before starting #require/#autoload specs
|
||||
# which snapshot $LOADED_FEATURES and could cause RubyGems to load twice.
|
||||
# #require specs also snapshot #require, and could end up redefining #require as the original core Kernel#require.
|
||||
@rubygems ||= begin
|
||||
require "rubygems"
|
||||
true
|
||||
rescue LoadError
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
def self.spec_setup
|
||||
preload_rubygems
|
||||
|
||||
@saved_loaded_features = $LOADED_FEATURES.clone
|
||||
@saved_load_path = $LOAD_PATH.clone
|
||||
ScratchPad.record []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue