Skip to content

Commit fbdf409

Browse files
committed
EngineDetector.ruby_version should allow dependency injection of version
1 parent 4592c43 commit fbdf409

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/concurrent/utility/engine.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def ruby_engine
3939
defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
4040
end
4141

42-
def ruby_version(comparison, major, minor = 0, patch = 0)
43-
result = (RUBY_VERSION.split('.').map(&:to_i) <=> [major, minor, patch])
42+
def ruby_version(comparison, major, minor, patch, version = RUBY_VERSION)
43+
result = (version.split('.').map(&:to_i) <=> [major, minor, patch])
4444
comparisons = { :== => [0],
4545
:>= => [1, 0],
4646
:<= => [-1, 0],

0 commit comments

Comments
 (0)