Avoid exposing ActiveSupport::Testing::NoSkip

It's only meant for Rails internal use.
This commit is contained in:
Jean Boussier 2023-10-27 09:03:30 +02:00
parent e33dbe1b3d
commit cb09616b94
2 changed files with 9 additions and 16 deletions

@ -1,14 +0,0 @@
# frozen_string_literal: true
module ActiveSupport
module Testing
module NoSkip # :nodoc:
private
def skip(message = nil, *)
flunk "Skipping tests is not allowed in this environment (#{message})\n" \
"Tests should only be skipped when the environment is missing a required dependency.\n" \
"This should never happen on CI."
end
end
end
end

@ -8,6 +8,13 @@
end
if ENV["CI"]
require File.join(__dir__, "../activesupport/lib/active_support/testing/no_skip")
ActiveSupport::TestCase.include(ActiveSupport::Testing::NoSkip)
module DisableSkipping # :nodoc:
private
def skip(message = nil, *)
flunk "Skipping tests is not allowed in this environment (#{message})\n" \
"Tests should only be skipped when the environment is missing a required dependency.\n" \
"This should never happen on CI."
end
end
ActiveSupport::TestCase.include(DisableSkipping)
end