Skip to content

Commit

Permalink
remove bang from find_by_short_id name
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaumik-Ashraf committed Sep 25, 2024
1 parent e120034 commit e690d77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/inferno/apps/cli/execute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/inferno/apps/cli/execute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e690d77

Please sign in to comment.