summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/did_you_mean/fixtures/book.rb2
-rw-r--r--test/did_you_mean/spell_checking/test_class_name_check.rb4
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