1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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 committed by Yuki Nishijima
parent 59a40feec2
commit b76a21aa45
Notes: git 2020-02-07 23:31:14 +09:00
2 changed files with 4 additions and 2 deletions

View file

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

View file

@ -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