Guest User

Untitled

a guest
Jun 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. diff --git a/src/org/jruby/java/proxies/ArrayJavaProxy.java b/src/org/jruby/java/proxies/ArrayJavaProxy.java
  2. index c0bea32..a2ba494 100644
  3. --- a/src/org/jruby/java/proxies/ArrayJavaProxy.java
  4. +++ b/src/org/jruby/java/proxies/ArrayJavaProxy.java
  5. @@ -133,6 +133,11 @@ public class ArrayJavaProxy extends JavaProxy {
  6. RubyModule javaArrayUtilities = context.getRuntime().getJavaSupport().getJavaArrayUtilitiesModule();
  7. return RuntimeHelpers.invoke(context, javaArrayUtilities, "java_to_ruby", this);
  8. }
  9. +
  10. + @JRubyMethod
  11. + public IRubyObject to_s(ThreadContext context) {
  12. + return getJavaArray().to_s();
  13. + }
  14.  
  15. public IRubyObject getRange(ThreadContext context, IRubyObject[] args) {
  16. if (args.length == 1) {
  17. diff --git a/test/test_io.rb b/test/test_io.rb
  18. index 4ab183d..77a2129 100644
  19. --- a/test/test_io.rb
  20. +++ b/test/test_io.rb
  21. @@ -484,11 +484,11 @@ class TestIO < Test::Unit::TestCase
  22. unless WINDOWS
  23. def test_sh_used_appropriately
  24. # should not use sh
  25. - p, o, i, e = IO.popen4("/bin/ps -a -f")
  26. - assert_match p.to_s, i.read.lines.grep(/\/bin\/ps/).first
  27. + p, o, i, e = IO.popen4("/bin/ps -a -x -f")
  28. + assert_match p.to_s, i.read.lines.grep(/\/bin\/ps -a -x -f/).first
  29.  
  30. # should use sh
  31. - p, o, i, e = IO.popen4("/bin/ps -a -f | grep ps'")
  32. + p, o, i, e = IO.popen4("/bin/ps -a -x -f | grep [/]bin/ps'")
  33. assert_no_match Regexp.new(p.to_s), i.read.grep(/\/bin\/ps/).first
  34. end
  35. end
Add Comment
Please, Sign In to add comment