Allow to force skip tests

This is useful for when a test depends on code not being loaded that
might be loaded by another test.
This commit is contained in:
Rafael Mendonça França 2024-01-04 03:34:07 +00:00
parent 4544b0d15b
commit ad343c5034
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
2 changed files with 2 additions and 1 deletions

@ -40,7 +40,7 @@ def to_json(*)
private
def require_or_skip(file)
require(file) || skip("'#{file}' was already loaded")
require(file) || force_skip("'#{file}' was already loaded")
end
def assert_same_with_or_without_active_support(subject)

@ -14,5 +14,6 @@ def skip(message = nil, *)
"This should never happen on CI."
end
end
ActiveSupport::TestCase.alias_method :skip, :force_skip
ActiveSupport::TestCase.include(DisableSkipping)
end