rb: Use defined? JRUBY_VERSION to detect JRuby [THRIFT-38]
From kevin@rapleaf.com
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@670980 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/deprecation_spec.rb b/lib/rb/spec/deprecation_spec.rb
index 57c2f77..b0cc527 100644
--- a/lib/rb/spec/deprecation_spec.rb
+++ b/lib/rb/spec/deprecation_spec.rb
@@ -177,12 +177,12 @@
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 @@
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