support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb

This commit is contained in:
S-H-GAMELINKS 2020-02-04 08:45:11 +00:00 коммит произвёл Yuki Nishijima
Родитель 59a40feec2
Коммит b76a21aa45
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -1,4 +1,4 @@
class Book
class Cover
class Spine
end
end

Просмотреть файл

@ -66,7 +66,9 @@ class ClassNameCheckTest < Test::Unit::TestCase
end
def test_does_not_suggest_user_input
error = assert_raise(NameError) { ::Book::Cover }
Book.send(:remove_const, :Spine) if Book.constants.include?(:Spine)
error = assert_raise(NameError) { ::Book::Spine }
# This is a weird require, but in a multi-threaded condition, a constant may
# be loaded between when a NameError occurred and when the spell checker