fake-aws-sdk 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NzFlYzIwMWZkMjRhYzg3MmY2ODY4YjdkZTY1MjVjM2U3YWFjMjg5Mw==
5
- data.tar.gz: !binary |-
6
- NmY5MjEyNDBmY2U1MDlhMTliY2MxNjNhMWE0YWQxMTRjOGRlMjUyYg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NGEyZDM3OTY5M2ZiMGQ2YWQyNTc0NDViNTE3ZDBhMDQ5NWM2ZmM5YTdiYjIw
10
- NGUxNDgyYzhiNWFkM2NjMGZhZjBjMzcxNzdmZTY2NDdjYWNjZjUyNjdlM2Ux
11
- OTFiOGVjODhmN2UzMjk1ZTk4ODBkMjVkMzY0MDZhZjc4YzAyNzQ=
12
- data.tar.gz: !binary |-
13
- MzhhODE0NjY2NzVjMjRlNWY5YTkxYjI2NGI1MWMzYjQwNDVkZjUyNTM2M2U1
14
- ZWM0YmI3MDAyMGQ4YmM5Zjc1ZWIwZDFkYzU0M2RlNzJhNDU5M2Q4ZTk2NDE4
15
- NTYxODAyOWM2NGYzMmJjMGJlOTZiNDFmMGVkZjBmNDc0NjE1ODE=
2
+ SHA1:
3
+ metadata.gz: df26b8be256655ec1d8bb338fef31be5192cf039
4
+ data.tar.gz: c3a50a35b787c73513e0cf79897c515b2e0b05d1
5
+ SHA512:
6
+ metadata.gz: 83a0bae057b6d4a7df70a22ebe3177192fad720d63453e6732d97d4b4e0130fe4609b8adcb6007d54c4252afba8bb60d48f2f5694d59df046b1c72ace2f3fdbf
7
+ data.tar.gz: b79e334b118534c125b990d510dd530ef8dec92906b90ee4b8f9b64b15add23cbd5ee3f890a39ef20fc3fcb75fd0e9d554041d6440df03ae542f8aca05d10f64
data/fake-aws-sdk.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["mdub@dogbiscuit.org"]
11
11
  gem.description = %q{Fake implementation of AWS SDK}
12
12
  gem.summary = gem.description
13
- gem.homepage = "http://github.com/cogent/fake-aws-sdk"
13
+ gem.homepage = "http://github.com/mdub/fake-aws-sdk"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -18,8 +18,16 @@ module FakeAWS
18
18
  @objects[key]
19
19
  end
20
20
 
21
+ def delete_all
22
+ @objects.clear
23
+ end
24
+
21
25
  include Enumerable
22
26
 
27
+ def delete_if(&block)
28
+ @objects.delete_if(&block)
29
+ end
30
+
23
31
  def each(&block)
24
32
  @objects.values.select(&:exists?).sort_by(&:key).each(&block)
25
33
  end
@@ -1,3 +1,3 @@
1
1
  module FakeAWS
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -53,6 +53,33 @@ describe FakeAWS::S3::ObjectCollection do
53
53
 
54
54
  end
55
55
 
56
+ describe "#delete_all" do
57
+
58
+ it "removes all the objects" do
59
+ objects.delete_all
60
+ objects.should be_empty
61
+ end
62
+
63
+ end
64
+
65
+ describe "#delete_if" do
66
+
67
+ before do
68
+ objects["hello/a.txt"].write("CONTENT")
69
+ objects["world/a.txt"].write("CONTENT")
70
+ objects.delete_if { |key| key =~ /hello/ }
71
+ end
72
+
73
+ it "deletes the hello folder" do
74
+ expect(objects["hello/a.txt"]).to_not exist
75
+ end
76
+
77
+ it "does not delete the world folder" do
78
+ expect(objects["world/a.txt"]).to exist
79
+ end
80
+
81
+ end
82
+
56
83
  end
57
84
 
58
85
  context "after referencing some objects (without writing content)" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake-aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-25 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fake implementation of AWS SDK
14
14
  email:
@@ -37,7 +37,7 @@ files:
37
37
  - spec/fake-aws/s3/object_collection_spec.rb
38
38
  - spec/fake-aws/s3/s3_object_spec.rb
39
39
  - spec/fake-aws/s3_spec.rb
40
- homepage: http://github.com/cogent/fake-aws-sdk
40
+ homepage: http://github.com/mdub/fake-aws-sdk
41
41
  licenses: []
42
42
  metadata: {}
43
43
  post_install_message:
@@ -46,17 +46,17 @@ require_paths:
46
46
  - lib
47
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - ! '>='
49
+ - - '>='
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - '>='
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.0.7
59
+ rubygems_version: 2.3.0
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Fake implementation of AWS SDK