mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* test/rake/test_rake_directory_task.rb
(TestRakeDirectoryTask#test_directory_win32): shouldn't create any file/directory on root directory. create on @tempdir (= Dir.pwd). see https://github.com/jimweirich/rake/issues/91 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									fb8ff8de93
								
							
						
					
					
						commit
						81ef9c66b7
					
				
					 2 changed files with 24 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,10 @@
 | 
			
		|||
Mon Nov 28 22:26:31 2011  NAKAMURA Usaku  <usa@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* test/rake/test_rake_directory_task.rb
 | 
			
		||||
	  (TestRakeDirectoryTask#test_directory_win32): shouldn't create any
 | 
			
		||||
	  file/directory on root directory.  create on @tempdir (= Dir.pwd).
 | 
			
		||||
	  see https://github.com/jimweirich/rake/issues/91
 | 
			
		||||
 | 
			
		||||
Mon Nov 28 12:57:29 2011  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* io.c (rb_write_error2): fwrite() returns ssize_t.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,20 +27,26 @@ class TestRakeDirectoryTask < Rake::TestCase
 | 
			
		|||
 | 
			
		||||
  if Rake::Win32.windows?
 | 
			
		||||
    def test_directory_win32
 | 
			
		||||
      drive = Dir.pwd
 | 
			
		||||
      while drive != File.dirname(drive)
 | 
			
		||||
        drive = File.dirname(drive)
 | 
			
		||||
      end
 | 
			
		||||
      drive = drive[0...-1] if drive[-1] == ?/
 | 
			
		||||
 | 
			
		||||
      desc "WIN32 DESC"
 | 
			
		||||
      directory 'c:/a/b/c'
 | 
			
		||||
      assert_equal FileTask, Task['c:'].class
 | 
			
		||||
      assert_equal FileCreationTask, Task['c:/a'].class
 | 
			
		||||
      assert_equal FileCreationTask, Task['c:/a/b'].class
 | 
			
		||||
      assert_equal FileCreationTask, Task['c:/a/b/c'].class
 | 
			
		||||
      assert_nil             Task['c:/'].comment
 | 
			
		||||
      assert_equal "WIN32 DESC",   Task['c:/a/b/c'].comment
 | 
			
		||||
      assert_nil             Task['c:/a/b'].comment
 | 
			
		||||
      directory File.join(Dir.pwd, 'a/b/c')
 | 
			
		||||
      assert_equal FileTask, Task[drive].class if drive[-1] == ?:
 | 
			
		||||
      assert_equal FileCreationTask, Task[File.join(Dir.pwd, 'a')].class
 | 
			
		||||
      assert_equal FileCreationTask, Task[File.join(Dir.pwd, 'a/b')].class
 | 
			
		||||
      assert_equal FileCreationTask, Task[File.join(Dir.pwd, 'a/b/c')].class
 | 
			
		||||
      assert_nil             Task[drive].comment
 | 
			
		||||
      assert_equal "WIN32 DESC",   Task[File.join(Dir.pwd, 'a/b/c')].comment
 | 
			
		||||
      assert_nil             Task[File.join(Dir.pwd, 'a/b')].comment
 | 
			
		||||
      verbose(false) {
 | 
			
		||||
        Task['c:/a/b'].invoke
 | 
			
		||||
        Task[File.join(Dir.pwd, 'a/b')].invoke
 | 
			
		||||
      }
 | 
			
		||||
      assert File.exist?('c:/a/b')
 | 
			
		||||
      refute File.exist?('c:/a/b/c')
 | 
			
		||||
      assert File.exist?(File.join(Dir.pwd, 'a/b'))
 | 
			
		||||
      refute File.exist?(File.join(Dir.pwd, 'a/b/c'))
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue