[前][次][番号順一覧][スレッド一覧]

ruby-changes:59956

From: S-H-GAMELINKS <ko1@a...>
Date: Fri, 7 Feb 2020 23:31:11 +0900 (JST)
Subject: [ruby-changes:59956] b76a21aa45 (master): support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb

https://git.ruby-lang.org/ruby.git/commit/?id=b76a21aa45

From b76a21aa45fff75909a66f8b20fc5856705f7862 Mon Sep 17 00:00:00 2001
From: S-H-GAMELINKS <gamelinks007@g...>
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


diff --git a/test/did_you_mean/fixtures/book.rb b/test/did_you_mean/fixtures/book.rb
index e6644a6..e31e629 100644
--- a/test/did_you_mean/fixtures/book.rb
+++ b/test/did_you_mean/fixtures/book.rb
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/did_you_mean/fixtures/book.rb#L1
 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 ffe7a4c..1b863ee 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 https://github.com/ruby/ruby/blob/trunk/test/did_you_mean/spell_checking/test_class_name_check.rb#L66
   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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]