Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit eec9347

Browse files
committed
Merge pull request #1080 from deivid-rodriguez/fix_jruby_version_check
Fix incorrect JRUBY version check
2 parents e523c5e + 660f1e0 commit eec9347

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rspec/mocks/method_reference.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
RSpec::Support.require_rspec_support 'comparable_version'
2+
13
module RSpec
24
module Mocks
35
# Represents a method on an object that may or may not be defined.
@@ -128,7 +130,7 @@ def method_implemented?(mod)
128130
#
129131
# This is necessary due to a bug in JRuby prior to 1.7.5 fixed in:
130132
# https://github.com/jruby/jruby/commit/99a0613fe29935150d76a9a1ee4cf2b4f63f4a27
131-
if RUBY_PLATFORM == 'java' && JRUBY_VERSION.split('.')[-1].to_i < 5
133+
if RUBY_PLATFORM == 'java' && RSpec::Support::ComparableVersion.new(JRUBY_VERSION) < '1.7.5'
132134
def find_method(mod)
133135
mod.dup.instance_method(@method_name)
134136
end

0 commit comments

Comments
 (0)