ruby-changes:60188
From: Nobuyoshi <ko1@a...>
Date: Wed, 26 Feb 2020 10:19:37 +0900 (JST)
Subject: [ruby-changes:60188] 0686e4181d (master): Fixed for older versions
https://git.ruby-lang.org/ruby.git/commit/?id=0686e4181d From 0686e4181d04dd911316a227753ceaa96d8c6533 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 26 Feb 2020 10:16:32 +0900 Subject: Fixed for older versions Fix up 66d1900423e6fb9774c2fe72dba8c2968b54d7ab, `RubyVM::MJIT` is available since ruby 2.6. diff --git a/test/csv/parse/test_general.rb b/test/csv/parse/test_general.rb index 4da1775..52b0cab 100644 --- a/test/csv/parse/test_general.rb +++ b/test/csv/parse/test_general.rb @@ -246,7 +246,10 @@ line,5,jkl https://github.com/ruby/ruby/blob/trunk/test/csv/parse/test_general.rb#L246 private def assert_parse_errors_out(data, **options) assert_raise(CSV::MalformedCSVError) do - timeout = (RubyVM::MJIT.enabled? ? 5 : 0.2) # for --jit-wait + timeout = 0.2 + if defined?(RubyVM::MJIT.enabled?) and RubyVM::MJIT.enabled? + timeout = 5 # for --jit-wait + end Timeout.timeout(timeout) do CSV.parse(data, **options) fail("Parse didn't error out") -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/