From 6dee08c056dc2bbf2479b47e5a341294a5706330 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Wed, 23 Jan 2019 11:45:01 +0900 Subject: Added condition for Object =~ comparison. --- spec/support/less_than_proc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/less_than_proc.rb b/spec/support/less_than_proc.rb index ddac5458b7..68d37b44c9 100644 --- a/spec/support/less_than_proc.rb +++ b/spec/support/less_than_proc.rb @@ -6,7 +6,7 @@ class LessThanProc < Proc def self.with(present) provided = Gem::Version.new(present.dup) new do |required| - if required =~ /[=><~]/ + if required.is_a?(String) && required =~ /[=><~]/ !Gem::Requirement.new(required).satisfied_by?(provided) else provided < Gem::Version.new(required) -- cgit v1.2.1