dummy_dropbox 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/dummy_dropbox.rb CHANGED
@@ -53,6 +53,12 @@ module Dropbox
53
53
  def download(path, options={})
54
54
  File.read( "#{Dropbox.files_root_path}/#{path}" )
55
55
  end
56
+
57
+ def delete(path, options={})
58
+ FileUtils.rm_rf( "#{Dropbox.files_root_path}/#{path}" )
59
+
60
+ return true
61
+ end
56
62
 
57
63
  def create_folder(path, options={})
58
64
  FileUtils.mkdir( "#{Dropbox.files_root_path}/#{path}" )
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DummyDropbox
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.9'
3
3
  end
@@ -23,6 +23,20 @@ class DummyDropboxTest < Test::Unit::TestCase
23
23
  assert_equal(['/file1.txt', '/folder1'], @session.list('').map{ |e| e.path } )
24
24
  assert_equal(['folder1/file2.txt', 'folder1/file3.txt'], @session.list('folder1').map{ |e| e.path } )
25
25
  end
26
+
27
+ def test_delete
28
+ FileUtils.mkdir_p( "#{DummyDropbox.root_path}/tmp_folder" )
29
+ 3.times { |i| FileUtils.touch( "#{DummyDropbox.root_path}/tmp_folder/#{i}.txt" ) }
30
+
31
+ assert( File.exists?( "#{DummyDropbox.root_path}/tmp_folder" ) )
32
+ assert( File.exists?( "#{DummyDropbox.root_path}/tmp_folder/0.txt" ) )
33
+
34
+ metadata = @session.delete '/tmp_folder/0.txt'
35
+ assert( !File.exists?( "#{DummyDropbox.root_path}/tmp_folder/0.txt" ) )
36
+
37
+ metadata = @session.delete '/tmp_folder'
38
+ assert( !File.exists?( "#{DummyDropbox.root_path}/tmp_folder" ) )
39
+ end
26
40
 
27
41
  def test_create_folder
28
42
  FileUtils.rm_r( "#{DummyDropbox.root_path}/tmp_folder" ) if File.exists?( "#{DummyDropbox.root_path}/tmp_folder" )
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dummy_dropbox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fernando Guillen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-16 00:00:00 +02:00
18
+ date: 2011-08-24 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency