From 0b556603e0997f5b602a251e1987a109091b912e Mon Sep 17 00:00:00 2001 From: Philip Li Date: Sat, 18 May 2024 21:32:49 +0800 Subject: [PATCH] spec/stats_spec.rb: resolve rubocop issue on ruby 2.5 spec/stats_spec.rb:15:20: C: [Correctable] Style/CaseLikeIf: Convert if-elsif to case-when. new_stat = if script =~ /^(kmsg)$/ ... ^^^^^^^^^^^^^^^^^^^^^^^ Signed-off-by: Philip Li --- spec/stats_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/stats_spec.rb b/spec/stats_spec.rb index dde4a2e01..89acec5bf 100644 --- a/spec/stats_spec.rb +++ b/spec/stats_spec.rb @@ -12,9 +12,10 @@ old_stat = File.read yaml_file stat_script = LKP::Programs.find_parser(script) - new_stat = if script =~ /^(kmsg)$/ + new_stat = case script + when /^(kmsg)$/ `RESULT_ROOT=/boot/1/vm- #{stat_script} #{file}` - elsif script =~ /^(dmesg|mpstat|fio)$/ + when /^(dmesg|mpstat|fio)$/ `#{stat_script} #{file}` else `#{stat_script} < #{file}`