alephant-cache 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c6fec79289d06c6c4cb6ffdf70f44595a3323e6
4
- data.tar.gz: 13a2d029f0f62f471ff68c0165fd5cffdf78f94d
3
+ metadata.gz: a32188fc17c39c5964aad1e0980c703738c91262
4
+ data.tar.gz: 54998d2325491884a905336a8df97cb49e08c2d0
5
5
  SHA512:
6
- metadata.gz: addd116f260d7d4ab7e64046e0d8048b231e222bce199642a66c1f2a188925b5cec453fd5d529b571e0c2ed09a5cf526ae8d34ef1bef3c446d158e9333fa2ec1
7
- data.tar.gz: b31b9e1971640ed2ec66d23ff00e207d435d1f25a30f396121e93f5b07cf415990b729752c89a32fad731bba6c6a44c93a79e60853ea3ce80de2d845b0e6e273
6
+ metadata.gz: 1218cc9a8fc5f6a597af5746b701c9cc95491e9bfc82025b968de3f96c42f60d4a3ba3c7e07907986493318d61ccd51aadbf9c5fff07c698cc49ff2bd9737cda
7
+ data.tar.gz: 63d1a276ef827aea735c910bf587adb79996b1af6ee195ea02f2024046416e0d20c9109309c65c9ddd8a426e1d5d22393913700097bdaf07bd5694f539add737
@@ -50,7 +50,7 @@ module Alephant
50
50
  def get(id)
51
51
  object = bucket.objects["#{path}/#{id}"]
52
52
  content = object.read
53
- content_type = object.content_type,
53
+ content_type = object.content_type
54
54
  meta_data = object.metadata.to_h
55
55
 
56
56
  logger.metric "CacheGets"
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  class Cache
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -26,19 +26,19 @@ describe Alephant::Cache do
26
26
  let(:num_object_in_path) { 100 }
27
27
  it "deletes all objects for a path" do
28
28
  filtered_object_collection = double()
29
- filtered_object_collection
30
- .should_receive(:delete_all)
29
+ expect(filtered_object_collection)
30
+ .to receive(:delete_all)
31
31
 
32
32
  s3_object_collection = double()
33
- s3_object_collection
34
- .should_receive(:with_prefix)
33
+ expect(s3_object_collection)
34
+ .to receive(:with_prefix)
35
35
  .with(path)
36
36
  .and_return(filtered_object_collection)
37
37
 
38
38
  s3_bucket = double()
39
- s3_bucket.should_receive(:objects).and_return(s3_object_collection)
39
+ expect(s3_bucket).to receive(:objects).and_return(s3_object_collection)
40
40
 
41
- AWS::S3.any_instance.stub(:buckets).and_return({ id => s3_bucket })
41
+ expect_any_instance_of(AWS::S3).to receive(:buckets).and_return({ id => s3_bucket })
42
42
 
43
43
  instance = subject.new(id, path)
44
44
  instance.clear
@@ -48,16 +48,16 @@ describe Alephant::Cache do
48
48
  describe "put(id, data)" do
49
49
  it "sets bucket path/id content data" do
50
50
  s3_object_collection = double()
51
- s3_object_collection.should_receive(:write).with(:data, { :content_type => 'foo/bar', :metadata=>{} })
51
+ expect(s3_object_collection).to receive(:write).with(:data, { :content_type => 'foo/bar', :metadata=>{} })
52
52
 
53
53
  s3_bucket = double()
54
- s3_bucket.should_receive(:objects).and_return(
54
+ expect(s3_bucket).to receive(:objects).and_return(
55
55
  {
56
56
  "path/id" => s3_object_collection
57
57
  }
58
58
  )
59
59
 
60
- AWS::S3.any_instance.stub(:buckets).and_return({ id => s3_bucket })
60
+ expect_any_instance_of(AWS::S3).to receive(:buckets).and_return({ id => s3_bucket })
61
61
  instance = subject.new(id, path)
62
62
 
63
63
  instance.put(id, data, 'foo/bar')
@@ -67,18 +67,18 @@ describe Alephant::Cache do
67
67
  describe "get(id)" do
68
68
  it "gets bucket path/id content data" do
69
69
  s3_object_collection = double()
70
- s3_object_collection.should_receive(:read).and_return("content")
71
- s3_object_collection.should_receive(:content_type).and_return("foo/bar")
72
- s3_object_collection.should_receive(:metadata).and_return({ :foo => :bar})
70
+ expect(s3_object_collection).to receive(:read).and_return("content")
71
+ expect(s3_object_collection).to receive(:content_type).and_return("foo/bar")
72
+ expect(s3_object_collection).to receive(:metadata).and_return({ :foo => :bar})
73
73
 
74
74
  s3_bucket = double()
75
- s3_bucket.should_receive(:objects).and_return(
75
+ expect(s3_bucket).to receive(:objects).and_return(
76
76
  {
77
77
  "path/id" => s3_object_collection
78
78
  }
79
79
  )
80
80
 
81
- AWS::S3.any_instance.stub(:buckets).and_return({ id => s3_bucket })
81
+ expect_any_instance_of(AWS::S3).to receive(:buckets).and_return({ id => s3_bucket })
82
82
 
83
83
  instance = subject.new(id, path)
84
84
  object_hash = instance.get(id)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC News
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement