mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* lib/fileutils.rb: fix visibility of FileUtils::NoWrite, Verbose, DryRun (backported from trunk, rev 1.66). [ruby-core:05954]
* test/fileutils/test_nowrite.rb: test it. * test/fileutils/test_dryrun.rb: new file. * test/fileutils/test_verbose.rb: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									cd244d63ca
								
							
						
					
					
						commit
						6e77ae4c13
					
				
					 3 changed files with 47 additions and 1 deletions
				
			
		|  | @ -5,10 +5,25 @@ require 'fileasserts' | |||
| require 'tmpdir' | ||||
| require 'test/unit' | ||||
| 
 | ||||
| class TestNoWrite < Test::Unit::TestCase | ||||
| class TestFileUtilsNoWrite < Test::Unit::TestCase | ||||
| 
 | ||||
|   include FileUtils::NoWrite | ||||
| 
 | ||||
|   def test_visibility | ||||
|     FileUtils::METHODS.each do |m| | ||||
|       assert_equal true, FileUtils::NoWrite.respond_to?(m, true), | ||||
|                    "FileUtils::NoWrite.#{m} is not defined" | ||||
|       assert_equal true, FileUtils::NoWrite.respond_to?(m, false), | ||||
|                    "FileUtils::NoWrite.#{m} is not public" | ||||
|     end | ||||
|     FileUtils::METHODS.each do |m| | ||||
|       assert_equal true, respond_to?(m, true), | ||||
|                    "FileUtils::NoWrite\##{m} is not defined" | ||||
|       assert_equal true, FileUtils::NoWrite.private_method_defined?(m), | ||||
|                    "FileUtils::NoWrite\##{m} is not private" | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   def my_rm_rf(path) | ||||
|     if File.exist?('/bin/rm') | ||||
|       system %Q[/bin/rm -rf "#{path}"] | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue