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

Fix incorrect JRUBY version check #1080

Merged
merged 1 commit into from
Apr 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/rspec/mocks/method_reference.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
RSpec::Support.require_rspec_support 'comparable_version'

module RSpec
module Mocks
# Represents a method on an object that may or may not be defined.
Expand Down Expand Up @@ -128,7 +130,7 @@ def method_implemented?(mod)
#
# This is necessary due to a bug in JRuby prior to 1.7.5 fixed in:
# https://github.com/jruby/jruby/commit/99a0613fe29935150d76a9a1ee4cf2b4f63f4a27
if RUBY_PLATFORM == 'java' && JRUBY_VERSION.split('.')[-1].to_i < 5
if RUBY_PLATFORM == 'java' && RSpec::Support::ComparableVersion.new(JRUBY_VERSION) < '1.7.5'
def find_method(mod)
mod.dup.instance_method(@method_name)
end
Expand Down