dragonfly-scp_data_store 0.0.2 → 0.0.3

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: a48d4694dcc5fb0024b55eb2293aa53bb7759fde
4
- data.tar.gz: 0a3e0830885538c850654610858d30ad628e8e70
3
+ metadata.gz: 54a0456bd124d12f32d6766d024c7d602f6377b5
4
+ data.tar.gz: a2ff78268dd6222ef774c879590154b91c70009e
5
5
  SHA512:
6
- metadata.gz: af032ab8450733593eec8cf890c73d171558dad9872b7d87903bfc8f8e6d778013c2aff19189d24c17ea3057f56764b2e5f358fd5c6438c9e80b6419cc93584f
7
- data.tar.gz: 060d8e1da49e644a241fd2cb6ab4dd1b48f477463e099fd90156b2b7219d8f4b508b4f411f376d7c8e2077885321392e2cc1d8ec850e01549e8e36d9e42f117b
6
+ metadata.gz: 3244e60c9a2bea1a6c95c03de95b8b87b56b7f20ec61449e2bbe7ed748b5daf60fa2ee8ca594560cb1ac8c89a6525bd5242aa924921243b0862095c076a62d41
7
+ data.tar.gz: 6ca87d2eae8247bd686fbc5427dec2ef983f99886326254e57b88408c77c7e413bf71b9e2ea807674a7aff7fbe7276ce52d044c97e0e306dc6bade97f3208511
@@ -6,6 +6,8 @@ require 'net/scp'
6
6
 
7
7
  module Dragonfly
8
8
  module ScpDataStore
9
+ class DataNotFound < RuntimeError; end
10
+
9
11
  class DataStore
10
12
  include ::Dragonfly::Configurable
11
13
 
@@ -43,7 +45,7 @@ module Dragonfly
43
45
  end
44
46
 
45
47
  def destroy(uid)
46
- raise DataNotFound
48
+ true
47
49
  end
48
50
 
49
51
  private
@@ -1,5 +1,5 @@
1
1
  module Dragonfly
2
2
  module ScpDataStore
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ describe Dragonfly::ScpDataStore::DataStore do
12
12
  folder: "images",
13
13
  base_url: "localhost:3000/images",
14
14
  )
15
- end
15
+ end
16
16
 
17
17
  it { data_store.host.should eq("localhost") }
18
18
  it { data_store.username.should eq("root") }
@@ -44,4 +44,42 @@ describe Dragonfly::ScpDataStore::DataStore do
44
44
  end
45
45
 
46
46
  end
47
+
48
+ describe "#retrieve" do
49
+ let(:data_store) do
50
+ Dragonfly::ScpDataStore::DataStore.new(
51
+ host: "localhost",
52
+ username: "root",
53
+ password: "password",
54
+ folder: "../fixtures/images",
55
+ base_url: "http://localhost:3000/images",
56
+ )
57
+ end
58
+
59
+ context :failure do
60
+ it "returns an uid unique uid" do
61
+ expect {
62
+ data_store.retrieve('missing.jpg')
63
+ }.to raise_error(Dragonfly::ScpDataStore::DataNotFound)
64
+ end
65
+ end
66
+
67
+ end
68
+
69
+ describe "#destroy" do
70
+ let(:data_store) do
71
+ Dragonfly::ScpDataStore::DataStore.new(
72
+ host: "localhost",
73
+ username: "root",
74
+ password: "password",
75
+ folder: "../fixtures/images",
76
+ base_url: "localhost:3000/images",
77
+ )
78
+ end
79
+
80
+ it "returns true" do
81
+ data_store.destroy('any_uid').should be_true
82
+ end
83
+
84
+ end
47
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly-scp_data_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matheus Bras
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-05 00:00:00.000000000 Z
12
+ date: 2013-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dragonfly
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.0.3
152
+ rubygems_version: 2.0.6
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: A dragonfly datastore adapter