THRIFT-3364 Fix ruby binary field encoding in TJSONProtocol
Client: Ruby
Patch: Nobuaki Sukegawa <nsukeg@gmail.com>

This closes #633
diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift
index 4e9fb47..50ae4c1 100644
--- a/test/DebugProtoTest.thrift
+++ b/test/DebugProtoTest.thrift
@@ -20,6 +20,7 @@
 namespace c_glib TTest
 namespace cpp thrift.test.debug
 namespace java thrift.test
+namespace rb thrift.test
 
 struct Doubles {
  1: double nan,
diff --git a/test/known_failures_Linux.json b/test/known_failures_Linux.json
index 5685efe..c22c906 100644
--- a/test/known_failures_Linux.json
+++ b/test/known_failures_Linux.json
@@ -96,8 +96,6 @@
   "go-nodejs_json_framed-ip-ssl",
   "go-perl_binary_buffered-ip-ssl",
   "go-perl_binary_framed-ip-ssl",
-  "go-rb_json_buffered-ip",
-  "go-rb_json_framed-ip",
   "hs-cpp_json_buffered-ip",
   "hs-cpp_json_framed-ip",
   "hs-csharp_binary_framed-ip",
@@ -220,15 +218,9 @@
   "py-rb_json_framed-ip",
   "rb-cpp_json_buffered-ip",
   "rb-cpp_json_framed-ip",
-  "rb-csharp_json_buffered-ip",
-  "rb-csharp_json_framed-ip",
-  "rb-hs_json_buffered-ip",
-  "rb-hs_json_framed-ip",
   "rb-java_json_buffered-ip",
   "rb-java_json_framed-fastframed-ip",
   "rb-java_json_framed-ip",
   "rb-nodejs_json_buffered-ip",
-  "rb-nodejs_json_framed-ip",
-  "rb-rb_json_buffered-ip",
-  "rb-rb_json_framed-ip"
-]
+  "rb-nodejs_json_framed-ip"
+]
\ No newline at end of file
diff --git a/test/rb/Gemfile b/test/rb/Gemfile
index 8301e44..58c04aa 100644
--- a/test/rb/Gemfile
+++ b/test/rb/Gemfile
@@ -4,3 +4,4 @@
 
 gem "rack", "~> 1.5.2"
 gem "thin", "~> 1.5.0"
+gem "test-unit"
diff --git a/test/rb/integration/TestClient.rb b/test/rb/integration/TestClient.rb
index b31a024..fb339c4 100755
--- a/test/rb/integration/TestClient.rb
+++ b/test/rb/integration/TestClient.rb
@@ -125,7 +125,7 @@
 
   def test_binary
     p 'test_binary'
-    val = [42, 0, 142, 242]
+    val = (0...256).reverse_each.to_a
     ret = @client.testBinary(val.pack('C*'))
     assert_equal(val, ret.bytes.to_a)
   end
diff --git a/test/rb/integration/TestServer.rb b/test/rb/integration/TestServer.rb
index 0021e2a..bab723a 100755
--- a/test/rb/integration/TestServer.rb
+++ b/test/rb/integration/TestServer.rb
@@ -32,6 +32,8 @@
    :testEnum, :testTypedef, :testMultiException].each do |meth|
 
     define_method(meth) do |thing|
+      p meth
+      p thing
       thing
     end