From 54aa19bf73513eb6349b9b7e4ae6e75daf212d9e Mon Sep 17 00:00:00 2001 From: Yuki Nishijima Date: Sat, 12 Oct 2024 09:47:23 +0900 Subject: [PATCH] Address rubocop offences --- features/step_definitions/flatware_steps.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/features/step_definitions/flatware_steps.rb b/features/step_definitions/flatware_steps.rb index 1728508..69711f1 100644 --- a/features/step_definitions/flatware_steps.rb +++ b/features/step_definitions/flatware_steps.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'benchmark' require 'etc' # helper methods available in all steps @@ -27,11 +28,8 @@ def flatware_process all_commands.find { |command| command.commandline.include? 'flatware' } end - def duration(&_block) - started_at = Time.now - yield - ensure - Time.now - started_at + def duration(&block) + Benchmark.realtime(&block) end end World(Support)