Skip to content

Commit

Permalink
Combining suite ID checks into single condition
Browse files Browse the repository at this point in the history
  • Loading branch information
alisawallace committed Aug 30, 2023
1 parent 1734c7c commit fa31368
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/inferno/config/boot/suites.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,10 @@
ObjectSpace.each_object(TracePoint, &:disable)

Inferno::Entities::TestSuite.descendants.each do |descendant|
if descendant.id.blank?
raise StandardError, 'Error initializing test suites: custom test suite ID cannot be blank'
end
# When ID not assigned in custom test suites, Runnable.id will return default ID
# equal to the custom test suite's parent class name
if descendant.id == 'Inferno::Entities::TestSuite'
raise StandardError, 'Error initializing test suite #{descendant.name}: test suite ID is not set'
if descendant.id.blank? || descendant.id == 'Inferno::Entities::TestSuite'
raise StandardError, "Error initializing test suite #{descendant.name}: test suite ID is not set"
end
end
end
Expand Down

0 comments on commit fa31368

Please sign in to comment.