diff options
author | S-H-GAMELINKS <gamelinks007@gmail.com> | 2020-02-04 08:45:11 +0000 |
---|---|---|
committer | Yuki Nishijima <yk.nishijima@gmail.com> | 2020-02-07 09:30:43 -0500 |
commit | b76a21aa45fff75909a66f8b20fc5856705f7862 (patch) | |
tree | 603e4b9718433f7455a5f9132fcebd248324bd7e /test/did_you_mean | |
parent | 59a40feec27790cbe07955eb00f1bc125c8d95e8 (diff) | |
download | ruby-b76a21aa45fff75909a66f8b20fc5856705f7862.tar.gz |
support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb
Diffstat (limited to 'test/did_you_mean')
-rw-r--r-- | test/did_you_mean/fixtures/book.rb | 2 | ||||
-rw-r--r-- | test/did_you_mean/spell_checking/test_class_name_check.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/did_you_mean/fixtures/book.rb b/test/did_you_mean/fixtures/book.rb index e6644a6263..e31e629d43 100644 --- a/test/did_you_mean/fixtures/book.rb +++ b/test/did_you_mean/fixtures/book.rb @@ -1,4 +1,4 @@ class Book - class Cover + class Spine end end diff --git a/test/did_you_mean/spell_checking/test_class_name_check.rb b/test/did_you_mean/spell_checking/test_class_name_check.rb index ffe7a4c31b..1b863ee27c 100644 --- a/test/did_you_mean/spell_checking/test_class_name_check.rb +++ b/test/did_you_mean/spell_checking/test_class_name_check.rb @@ -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 |