From e690d77932bcd6e633bee6eadc0266a245519bca Mon Sep 17 00:00:00 2001 From: Shaumik-Ashraf Date: Wed, 25 Sep 2024 11:41:21 -0400 Subject: [PATCH] remove bang from find_by_short_id name --- lib/inferno/apps/cli/execute.rb | 6 +++--- spec/inferno/apps/cli/execute_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/inferno/apps/cli/execute.rb b/lib/inferno/apps/cli/execute.rb index 7bca723d4..9284ce975 100644 --- a/lib/inferno/apps/cli/execute.rb +++ b/lib/inferno/apps/cli/execute.rb @@ -168,16 +168,16 @@ def dispatch_job(test_run) def groups return [] if options[:groups].blank? - @groups ||= options[:groups]&.map { |short_id| find_by_short_id!(test_groups_repo, short_id) } + @groups ||= options[:groups]&.map { |short_id| find_by_short_id(test_groups_repo, short_id) } end def tests return [] if options[:tests].blank? - @tests ||= options[:tests]&.map { |short_id| find_by_short_id!(tests_repo, short_id) } + @tests ||= options[:tests]&.map { |short_id| find_by_short_id(tests_repo, short_id) } end - def find_by_short_id!(repo, short_id) + def find_by_short_id(repo, short_id) repo.all.each do |entity| return entity if short_id == entity.short_id && suite.id == entity.suite.id end diff --git a/spec/inferno/apps/cli/execute_spec.rb b/spec/inferno/apps/cli/execute_spec.rb index deaa946d0..c3cd42b0d 100644 --- a/spec/inferno/apps/cli/execute_spec.rb +++ b/spec/inferno/apps/cli/execute_spec.rb @@ -113,10 +113,10 @@ end end - describe '#find_by_short_id!' do + describe '#find_by_short_id' do it 'raises standard error when entity not found by short id' do expect do - instance.find_by_short_id!(Inferno::Repositories::Tests.new, 'does_not_exist') + instance.find_by_short_id(Inferno::Repositories::Tests.new, 'does_not_exist') end.to raise_error(StandardError) end end