From 13956aada9c999abb59e5cb7e1c7c780ebec660d Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 20 Dec 2021 20:31:57 +0900 Subject: [PATCH] This patch has been merged upstream https://github.com/test-unit/test-unit-rails/pull/24 --- ..._unit_rails_triple_nested_sub_test_case.rb | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 kaminari-core/test/support/test_unit_rails_triple_nested_sub_test_case.rb diff --git a/kaminari-core/test/support/test_unit_rails_triple_nested_sub_test_case.rb b/kaminari-core/test/support/test_unit_rails_triple_nested_sub_test_case.rb deleted file mode 100644 index 9504b69..0000000 --- a/kaminari-core/test/support/test_unit_rails_triple_nested_sub_test_case.rb +++ /dev/null @@ -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