mirror of
				https://github.com/fog/fog.git
				synced 2022-11-09 13:51:43 -05:00 
			
		
		
		
	Ignore existing directory when creating on local storage
This commit is contained in:
		
							parent
							
								
									cae2af0806
								
							
						
					
					
						commit
						9fc461f0f8
					
				
					 2 changed files with 17 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -40,7 +40,7 @@ module Fog
 | 
			
		|||
        def save
 | 
			
		||||
          requires :key
 | 
			
		||||
 | 
			
		||||
          Dir.mkdir(path)
 | 
			
		||||
          FileUtils.mkpath(path)
 | 
			
		||||
          true
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										16
									
								
								tests/local/models/directory_tests.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								tests/local/models/directory_tests.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
Shindo.tests('Storage[:local] | directory', ["local"]) do
 | 
			
		||||
 | 
			
		||||
  pending if Fog.mocking?
 | 
			
		||||
 | 
			
		||||
  before do
 | 
			
		||||
    @options = { :local_root => '~/.fog' }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  tests('save') do
 | 
			
		||||
    returns(true) do
 | 
			
		||||
      connection = Fog::Storage::Local.new(@options)
 | 
			
		||||
      connection.directories.create(:key => 'directory')
 | 
			
		||||
      connection.directories.create(:key => 'directory')
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue