fog 0.2.13 → 0.2.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
7
7
  ## If your rubyforge_project name is different, then edit it and comment out
8
8
  ## the sub! line in the Rakefile
9
9
  s.name = 'fog'
10
- s.version = '0.2.13'
11
- s.date = '2010-07-12'
10
+ s.version = '0.2.14'
11
+ s.date = '2010-07-13'
12
12
  s.rubyforge_project = 'fog'
13
13
 
14
14
  ## Make sure your summary is short. The description may be as long
data/lib/fog.rb CHANGED
@@ -40,7 +40,7 @@ require 'fog/vcloud'
40
40
  module Fog
41
41
 
42
42
  unless const_defined?(:VERSION)
43
- VERSION = '0.2.13'
43
+ VERSION = '0.2.14'
44
44
  end
45
45
 
46
46
  module Mock
@@ -20,7 +20,7 @@ module Fog
20
20
  response[name] = @value.to_f
21
21
  when 'Name'
22
22
  @attribute = @value
23
- response['Attributes'][@attribute] = []
23
+ response['Attributes'][@attribute] ||= []
24
24
  when 'RequestId'
25
25
  response[name] = @value
26
26
  when 'Value'
@@ -24,7 +24,7 @@ module Fog
24
24
  response['Items'][@item_name] = {}
25
25
  else
26
26
  @attribute_name = @value
27
- response['Items'][@item_name][@attribute_name] = []
27
+ response['Items'][@item_name][@attribute_name] ||= []
28
28
  end
29
29
  when 'NextToken', 'RequestId'
30
30
  response[name] = @value
@@ -19,6 +19,15 @@ describe 'SimpleDB.get_attributes' do
19
19
  end
20
20
  end
21
21
 
22
+ it 'should return multi-value attributes from get_attributes' do
23
+ AWS[:sdb].put_attributes(@domain_name, 'buzz', { "attr" => "foo" })
24
+ AWS[:sdb].put_attributes(@domain_name, 'buzz', { "attr" => "foo2" })
25
+ eventually do
26
+ actual = AWS[:sdb].get_attributes(@domain_name, 'buzz')
27
+ actual.body["Attributes"]["attr"].should == ['foo', 'foo2']
28
+ end
29
+ end
30
+
22
31
  it 'should have attributes for foo after put_attributes' do
23
32
  AWS[:sdb].put_attributes(@domain_name, 'foo', { :bar => :baz })
24
33
  eventually do
@@ -3,7 +3,24 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
3
3
  describe 'SimpleDB.select' do
4
4
  describe 'success' do
5
5
 
6
- it "should have some specs"
6
+ before(:each) do
7
+ @domain_name = "fog_domain_#{Time.now.to_i}"
8
+ AWS[:sdb].create_domain(@domain_name)
9
+ end
10
+
11
+ after(:each) do
12
+ AWS[:sdb].delete_domain(@domain_name)
13
+ end
14
+
15
+ it 'should return multi-value attributes when present' do
16
+ @item = "someitem_fog_domain_#{Time.now.to_i}"
17
+ AWS[:sdb].put_attributes(@domain_name, @item, { "attr" => "foo" })
18
+ AWS[:sdb].put_attributes(@domain_name, @item, { "attr" => "foo2" })
19
+ eventually do
20
+ actual = AWS[:sdb].select("select * from #{@domain_name}")
21
+ actual.body['Items'][@item]["attr"].should == ['foo','foo2']
22
+ end
23
+ end
7
24
 
8
25
  end
9
- end
26
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 13
9
- version: 0.2.13
8
+ - 14
9
+ version: 0.2.14
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-12 00:00:00 -07:00
17
+ date: 2010-07-13 00:00:00 -07:00
18
18
  default_executable: fog
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency