gom-couchdb-adapter 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -53,7 +53,7 @@ class GOM::Storage::CouchDB::Adapter < GOM::Storage::Adapter
53
53
  private
54
54
 
55
55
  def initialize_server
56
- @server = ::CouchDB::Server.new *configuration.values_at(:host, :port).compact
56
+ @server = ::CouchDB::Server.new *configuration.values_at(:host, :port, :username, :password)
57
57
  end
58
58
 
59
59
  def clear_server
@@ -10,12 +10,16 @@ describe GOM::Storage::CouchDB::Adapter do
10
10
  CouchDB::Database.stub :new => @database
11
11
 
12
12
  @configuration = mock GOM::Storage::Configuration, :name => "test_storage", :views => :test_views
13
- @configuration.stub(:[]).with(:database).and_return("test")
13
+ @configuration.stub :[] do |key|
14
+ case key
15
+ when :database then "test"
16
+ end
17
+ end
14
18
  @configuration.stub :values_at do |*arguments|
15
- result = nil
16
- result = [ "host", 1234 ] if arguments == [ :host, :port ]
17
- result = [ true, true ] if arguments == [ :delete_database_if_exists, :create_database_if_missing ]
18
- result
19
+ case arguments
20
+ when [ :host, :port, :username, :password ] then [ "host", 1234, "test", "test" ]
21
+ when [ :delete_database_if_exists, :create_database_if_missing ] then [ true, true ]
22
+ end
19
23
  end
20
24
 
21
25
  @design = mock CouchDB::Design
@@ -32,7 +36,7 @@ describe GOM::Storage::CouchDB::Adapter do
32
36
  describe "#setup" do
33
37
 
34
38
  it "should initialize a server" do
35
- CouchDB::Server.should_receive(:new).with("host", 1234).and_return(@server)
39
+ CouchDB::Server.should_receive(:new).with("host", 1234, "test", "test").and_return(@server)
36
40
  @adapter.setup
37
41
  end
38
42
 
@@ -4,6 +4,8 @@ GOM::Storage.configure {
4
4
  name :test_storage
5
5
  adapter :couchdb
6
6
  database "test"
7
+ username "test"
8
+ password "test"
7
9
  delete_database_if_exists true
8
10
  create_database_if_missing true
9
11
  view {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gom-couchdb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-15 00:00:00.000000000 +02:00
12
+ date: 2011-08-26 00:00:00.000000000 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: gom
17
- requirement: &16512820 !ruby/object:Gem::Requirement
17
+ requirement: &8387240 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,21 +22,21 @@ dependencies:
22
22
  version: 0.4.2
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *16512820
25
+ version_requirements: *8387240
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: couchdb
28
- requirement: &16512320 !ruby/object:Gem::Requirement
28
+ requirement: &8386500 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.3
33
+ version: 0.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *16512320
36
+ version_requirements: *8386500
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &16511840 !ruby/object:Gem::Requirement
39
+ requirement: &8385800 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '2'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *16511840
47
+ version_requirements: *8385800
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: reek
50
- requirement: &16511340 !ruby/object:Gem::Requirement
50
+ requirement: &8385120 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '1.2'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *16511340
58
+ version_requirements: *8385120
59
59
  description: CouchDB storage adapter for the General Object Mapper. Currently, version
60
60
  1.0 of CouchDB is supported.
61
61
  email: b.phifty@gmail.com