From b76a21aa45fff75909a66f8b20fc5856705f7862 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Tue, 4 Feb 2020 08:45:11 +0000 Subject: support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb --- test/did_you_mean/fixtures/book.rb | 2 +- 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 -- cgit v1.2.3