This patch has been merged upstream

https://github.com/test-unit/test-unit-rails/pull/24
This commit is contained in:
Akira Matsuda 2021-12-20 20:31:57 +09:00
parent aa54fbd73a
commit 13956aada9
1 changed files with 0 additions and 19 deletions

View File

@ -1,19 +0,0 @@
# Monkey-patching test-unit-rails not to raise NameError from triple-nested sub_test_case
ActionView::TestCase.class_eval do
class << self
def sub_test_case(name, &block)
parent_test_case = self
sub_test_case = Class.new(self) do
singleton_class = class << self; self; end
singleton_class.__send__(:define_method, :name) do
[parent_test_case.name, name].compact.join("::")
end
singleton_class.__send__(:define_method, :anonymous?) do
true
end
end
sub_test_case.class_eval(&block)
sub_test_case
end
end
end