mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	support multi-run test for test/did_you_mean/spell_checking/test_class_name_check.rb
This commit is contained in:
		
							parent
							
								
									59a40feec2
								
							
						
					
					
						commit
						b76a21aa45
					
				
				
				Notes:
				
					git
				
				2020-02-07 23:31:14 +09:00 
				
			
			
			
		
		
					 2 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue