rb: Use defined? JRUBY_VERSION to detect JRuby [THRIFT-38]
authorKevin Clark <kclark@apache.org>
Tue, 24 Jun 2008 01:05:55 +0000 (01:05 +0000)
committerKevin Clark <kclark@apache.org>
Tue, 24 Jun 2008 01:05:55 +0000 (01:05 +0000)
From kevin@rapleaf.com

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670980 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/spec/deprecation_spec.rb

index 57c2f77..b0cc527 100644 (file)
@@ -177,12 +177,12 @@ describe "deprecate_class!" do
   it_should_behave_like "deprecation"
 
   def stub_stderr_jruby(klass)
-    return if RUBY_PLATFORM != "java"
+    return unless defined? JRUBY_VERSION
     stub_stderr(klass, nil, caller.first)
   end
 
   def stub_stderr_mri(klass, offset=1)
-    return if RUBY_PLATFORM == "java"
+    return if defined? JRUBY_VERSION
     stub_stderr(klass, offset, caller.first)
   end
 
@@ -300,12 +300,12 @@ describe "deprecate_module!" do
   it_should_behave_like "deprecation"
 
   def stub_stderr_jruby(mod)
-    return if RUBY_PLATFORM != "java"
+    return unless defined? JRUBY_VERSION
     stub_stderr(mod, nil, caller.first)
   end
 
   def stub_stderr_mri(mod, offset=1)
-    return if RUBY_PLATFORM == "java"
+    return if defined? JRUBY_VERSION
     stub_stderr(mod, offset, caller.first)
   end