@@ -352,57 +352,6 @@ def newRuntime() # use the current runtime instead of creating new
352
352
should_eval_as_eql_to "Gem.loaded_specs['rack'].version.to_s" , '1.3.6'
353
353
end
354
354
355
- # should not matter on 1.7.x due https://github.com/jruby/jruby/pull/123
356
- if JRUBY_VERSION < '1.7.0'
357
- it "does not load any features (until load path is adjusted)" do
358
- set_runtime_environment ( "false" )
359
- # due to incorrectly detected jruby.home some container e.g. WebSphere 8
360
- # fail if things such as 'fileutils' get required during runtime init !
361
-
362
- # TODO: WTF? JRuby magic - $LOADED_FEATURES seems to get "inherited" if
363
- # Ruby.newInstance(config) is called with the factory's defaultConfig,
364
- # but only if it's executed with bundler e.g. `bundle exec rake spec`
365
- #@runtime = app_factory.new_runtime
366
- @runtime = org . jruby . Ruby . newInstance
367
- app_factory . send :initRuntime , @runtime
368
-
369
- #@runtime.evalScriptlet 'puts "initRuntime $LOADED_FEATURES: #{$LOADED_FEATURES.inspect}"'
370
- # NOTE: the above scriptlet behaves slightly different on Travis-CI
371
- # depending on whether jruby + JRUBY_OPTS="--1.9" is used and or using
372
- # jruby-19mode with the later the LOADED_FEATURES do get expanded e.g. :
373
- #
374
- # "/home/travis/builds/kares/jruby-rack/target/classes/rack/handler/servlet.rb",
375
- # "/home/travis/builds/kares/jruby-rack/target/classes/jruby/rack.rb",
376
- # "/home/travis/builds/kares/jruby-rack/target/classes/jruby/rack/environment.rb",
377
- # "java.rb",
378
- # "/home/travis/.rvm/rubies/jruby-1.6.8-d19/lib/ruby/site_ruby/shared/builtin/javasupport.rb",
379
- # "/home/travis/.rvm/rubies/jruby-1.6.8-d19/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb",
380
- # ...
381
- #
382
- # compared to jruby --1.9 :
383
- #
384
- # "enumerator.jar",
385
- # "rack/handler/servlet.rb",
386
- # "jruby/rack.rb",
387
- # "jruby/rack/environment.rb",
388
- # "java.rb",
389
- # "builtin/javasupport.rb",
390
- # "builtin/javasupport/java.rb",
391
- # ...
392
-
393
- reject_files =
394
- "p =~ /.jar$/ || " +
395
- "p =~ /^builtin/ || " +
396
- "p =~ /java.rb$/ || p =~ /jruby.rb$/ || " +
397
- "p =~ /jruby\\ /java.*.rb/ || " +
398
- "p =~ /jruby\\ /rack.*.rb/ || " +
399
- "p =~ /^rack\\ /handler\\ /servlet/"
400
- # NOTE: fails with JRuby 1.7 as it has all kind of things loaded e.g. :
401
- # thread.rb, rbconfig.rb, java.rb, lib/ruby/shared/rubygems.rb etc
402
- should_eval_as_eql_to "$LOADED_FEATURES.reject { |p| #{ reject_files } }" , [ ]
403
- end
404
- end
405
-
406
355
it "initializes the $servlet_context global variable" do
407
356
@runtime = app_factory . new_runtime
408
357
should_not_eval_as_nil "defined?($servlet_context)"
@@ -429,10 +378,10 @@ def newRuntime() # use the current runtime instead of creating new
429
378
set_config 'jruby.runtime.env' , 'false'
430
379
set_config 'jruby.runtime.env.rubyopt' , 'true'
431
380
432
- app_factory = app_factory_with_RUBYOPT '-rubygems '
381
+ app_factory = app_factory_with_RUBYOPT '-W:no-deprecated '
433
382
@runtime = app_factory . newRuntime
434
383
should_eval_as_nil "ENV['HOME']"
435
- should_eval_as_eql_to "ENV['RUBYOPT']" , '-rubygems '
384
+ should_eval_as_eql_to "ENV['RUBYOPT']" , '-W:no-deprecated '
436
385
end
437
386
438
387
it "keeps RUBYOPT by default with empty ENV (backwards compat)" do
@@ -490,7 +439,7 @@ def newRuntime() # use the current runtime instead of creating new
490
439
491
440
private
492
441
493
- def app_factory_with_RUBYOPT ( rubyopt = '-rubygems' )
442
+ def app_factory_with_RUBYOPT ( rubyopt )
494
443
app_factory =
495
444
Class . new ( org . jruby . rack . DefaultRackApplicationFactory ) do
496
445
@@ -990,7 +939,6 @@ def createRackServletWrapper(runtime, rackup); end
990
939
begin
991
940
@shared_factory . init ( @rack_context )
992
941
rescue org . jruby . rack . RackInitializationException => e
993
- e = unwrap_native_exception ( e )
994
942
expect ( e . message ) . to eql 'java.lang.ArithmeticException: 42'
995
943
else
996
944
fail "expected to rescue RackInitializationException"
0 commit comments