Skip to content

Commit

Permalink
spec/stats_spec.rb: resolve rubocop issue on ruby 2.5
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rli9 committed May 18, 2024
1 parent a887338 commit 0b55660
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/stats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down

0 comments on commit 0b55660

Please sign in to comment.