Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed the configuration specs

  • Loading branch information...
commit 99c1cab336289e41341dec8d4eb7d14951b315ab 1 parent 989588e
Philipp Brüll authored
6 .travis.yml
... ... @@ -1,2 +1,8 @@
1 1 notifications:
2 2 disable: true
  3 +rvm:
  4 + - 1.8.7
  5 + - 1.9.2
  6 + - rbx
  7 + - ree
  8 + - jruby
2  README.rdoc
Source Rendered
@@ -8,6 +8,8 @@ is plugged-in via an adapter interface. Currently, the following adapters are pr
8 8 * filesystem - http://github.com/phifty/gom-filesystem-adapter
9 9 * couchdb - http://github.com/phifty/gom-couchdb-adapter
10 10
  11 +http://travis-ci.org/phifty/gom.png
  12 +
11 13 == Configuration
12 14
13 15 At the beginning of your program the storage configuration should be done with the <tt>GOM::Storage.configure</tt>
8 lib/gom/storage/configuration.rb
@@ -13,7 +13,7 @@ class GOM::Storage::Configuration
13 13 not_nil :name, :adapter
14 14 nested {
15 15 view {
16   - not_nil :name, :adapter_type
  16 + not_nil :name, :kind
17 17 }
18 18 }
19 19 }
@@ -83,9 +83,9 @@ def self.configure(&block)
83 83 end
84 84
85 85 def self.view(hash)
86   - type = hash[:adapter_type]
87   - method_name = :"#{type}_view"
88   - raise NotImplementedError, "the view type '#{type}' doesn't exists" unless self.respond_to?(method_name)
  86 + kind = hash[:kind]
  87 + method_name = :"#{kind}_view"
  88 + raise NotImplementedError, "the view kind '#{kind}' doesn't exists" unless self.respond_to?(method_name)
89 89 self.send method_name, hash
90 90 end
91 91
6 spec/lib/gom/storage/configuration_spec.rb
@@ -13,12 +13,12 @@
13 13 adapter :test
14 14 view {
15 15 name :test_object_class_view
16   - adapter_type :class
  16 + kind :class
17 17 model_class Object
18 18 }
19 19 view {
20 20 name :test_map_view
21   - adapter_type :map_reduce
  21 + kind :map_reduce
22 22 map_function "function(document) { }"
23 23 reduce_function "function(key, values) { }"
24 24 }
@@ -113,7 +113,7 @@
113 113 end
114 114
115 115 it "should raise a #{NotImplementedError} if the view type is invalid" do
116   - @configuration["view"] << { :name => "test", :adapter_type => "invalid" }
  116 + @configuration["view"] << { :name => "test", :kind => "invalid" }
117 117 lambda do
118 118 @configuration.views[:test_invalid_view]
119 119 end.should raise_error(NotImplementedError)
4 spec/spec_helper.rb
@@ -12,12 +12,12 @@
12 12 adapter :fake_adapter
13 13 view {
14 14 name :test_object_class_view
15   - adapter_type :class
  15 + kind :class
16 16 model_class Object
17 17 }
18 18 view {
19 19 name :test_map_view
20   - adapter_type :map_reduce
  20 + kind :map_reduce
21 21 map_function "function(document) { }"
22 22 reduce_function "function(key, values) { }"
23 23 }

0 comments on commit 99c1cab

Please sign in to comment.
Something went wrong with that request. Please try again.