mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Use a temporary file for chown test
Errno::EROFS may occur when the source tree is placed in a read-only filesystem.
This commit is contained in:
		
							parent
							
								
									c147eeff7c
								
							
						
					
					
						commit
						fcd8bafd08
					
				
					 1 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -233,11 +233,9 @@ class TestFile < Test::Unit::TestCase
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  def test_chown
 | 
			
		||||
    assert_nothing_raised {
 | 
			
		||||
      File.open(__FILE__) {|f| f.chown(-1, -1) }
 | 
			
		||||
    }
 | 
			
		||||
    assert_nothing_raised("[ruby-dev:27140]") {
 | 
			
		||||
      File.open(__FILE__) {|f| f.chown nil, nil }
 | 
			
		||||
    Tempfile.create("test-chown") {|f|
 | 
			
		||||
      assert_nothing_raised {f.chown(-1, -1)}
 | 
			
		||||
      assert_nothing_raised("[ruby-dev:27140]") {f.chown(nil, nil)}
 | 
			
		||||
    }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue