зеркало из https://github.com/github/ruby.git
support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb
This commit is contained in:
Родитель
59a40feec2
Коммит
b76a21aa45
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче