@@ -311,12 +311,10 @@ def newRuntime() # use the current runtime instead of creating new
311311 end
312312
313313 it "loads specified version of rack" , :lib => :stub do
314- gem_install_rack_unless_installed '1.3.10'
314+ gem_install_unless_installed 'rack' , '1.3.10'
315315 set_config 'jruby.runtime.env' , 'false'
316316
317- script = "" +
318- "# rack.version: ~>1.3.6\n " +
319- "Proc.new { 'proc-rack-app' }"
317+ script = "# rack.version: ~>1.3.6\n Proc.new { 'proc-rack-app' }"
320318 app_factory . setRackupScript script
321319 @runtime = app_factory . newRuntime
322320 @runtime . evalScriptlet "ENV['GEM_HOME'] = #{ ENV [ 'GEM_HOME' ] . inspect } "
@@ -330,7 +328,7 @@ def newRuntime() # use the current runtime instead of creating new
330328 end
331329
332330 it "loads bundler with rack" , :lib => :stub do
333- gem_install_rack_unless_installed '1.3.6'
331+ gem_install_unless_installed 'rack' , '1.3.6'
334332 set_config 'jruby.runtime.env' , 'false'
335333
336334 script = "# encoding: UTF-8\n " +
@@ -354,20 +352,6 @@ def newRuntime() # use the current runtime instead of creating new
354352 should_eval_as_eql_to "Gem.loaded_specs['rack'].version.to_s" , '1.3.6'
355353 end
356354
357- def gem_install_rack_unless_installed ( version )
358- begin
359- if Gem ::Specification . respond_to? :find_by_name
360- Gem ::Specification . find_by_name 'rack' , version
361- else
362- raise Gem ::LoadError unless Gem . available? 'rack' , version
363- end
364- rescue Gem ::LoadError
365- require 'rubygems/dependency_installer'
366- installer = Gem ::DependencyInstaller . new
367- installer . install 'rack' , version
368- end
369- end
370-
371355 # should not matter on 1.7.x due https://github.com/jruby/jruby/pull/123
372356 if JRUBY_VERSION < '1.7.0'
373357 it "does not load any features (until load path is adjusted)" do
0 commit comments