@@ -24,16 +24,6 @@ def await
2424 end
2525 end
2626
27- def setup
28- super
29-
30- @old_loaded_features = $LOADED_FEATURES. dup
31- assert_raise LoadError do
32- require 'test_gem_require_a'
33- end
34- $LOADED_FEATURES. replace @old_loaded_features
35- end
36-
3727 def assert_require ( path )
3828 assert require ( path ) , "'#{ path } ' was already required"
3929 end
@@ -88,8 +78,6 @@ def test_dash_i_beats_gems
8878 FileUtils . mkdir_p File . dirname c_rb
8979 File . open ( c_rb , 'w' ) { |f | f . write "class Object; HELLO = 'world' end" }
9080
91- lp = $LOAD_PATH. dup
92-
9381 # Pretend to provide a commandline argument that overrides a file in gem b
9482 $LOAD_PATH. unshift dash_i_arg
9583
@@ -98,7 +86,6 @@ def test_dash_i_beats_gems
9886 assert_equal "world" , ::Object ::HELLO
9987 assert_equal %w[ a-1 b-1 ] , loaded_spec_names
10088 ensure
101- $LOAD_PATH. replace lp
10289 Object . send :remove_const , :HELLO if Object . const_defined? :HELLO
10390 end
10491
@@ -132,8 +119,6 @@ def test_dash_i_beats_default_gems
132119
133120 assert_require 'test_gem_require_a'
134121
135- lp = $LOAD_PATH. dup
136-
137122 # Pretend to provide a commandline argument that overrides a file in gem b
138123 $LOAD_PATH. unshift dash_i_arg
139124
@@ -142,7 +127,6 @@ def test_dash_i_beats_default_gems
142127 assert_equal "world" , ::Object ::HELLO
143128 assert_equal %w[ a-1 b-1 ] , loaded_spec_names
144129 ensure
145- $LOAD_PATH. replace lp
146130 Object . send :remove_const , :HELLO if Object . const_defined? :HELLO
147131 end
148132
@@ -153,16 +137,10 @@ def test_dash_i_respects_default_library_extension_priority
153137 dash_i_ext_arg = util_install_extension_file ( 'a' )
154138 dash_i_lib_arg = util_install_ruby_file ( 'a' )
155139
156- lp = $LOAD_PATH. dup
157-
158- begin
159- $LOAD_PATH. unshift dash_i_lib_arg
160- $LOAD_PATH. unshift dash_i_ext_arg
161- assert_require 'a'
162- assert_match ( /a\. rb$/ , $LOADED_FEATURES. last )
163- ensure
164- $LOAD_PATH. replace lp
165- end
140+ $LOAD_PATH. unshift dash_i_lib_arg
141+ $LOAD_PATH. unshift dash_i_ext_arg
142+ assert_require 'a'
143+ assert_match ( /a\. rb$/ , $LOADED_FEATURES. last )
166144 end
167145
168146 def test_concurrent_require
0 commit comments