Adding spec for JRUBY-5946

 This  accompanies https://github.com/jruby/jruby/commit/2c8e31014402907549090ca19531bda149ef7e61