couchdb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/couchdb/design.rb +2 -1
- data/spec/acceptance/views_spec.rb +11 -0
- data/spec/lib/couchdb/design_spec.rb +3 -3
- metadata +3 -3
data/lib/couchdb/design.rb
CHANGED
@@ -19,6 +19,17 @@ describe "views" do
|
|
19
19
|
@design.save
|
20
20
|
end
|
21
21
|
|
22
|
+
describe "selecting a view by it's name" do
|
23
|
+
|
24
|
+
it "should return the right view" do
|
25
|
+
view = @design.views[:view_1]
|
26
|
+
view.should be_instance_of(CouchDB::Design::View)
|
27
|
+
view.map.should == @view.map
|
28
|
+
view.reduce.should == @view.reduce
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
22
33
|
describe "collection" do
|
23
34
|
|
24
35
|
it "should return a collection including the right rows" do
|
@@ -84,12 +84,12 @@ describe CouchDB::Design do
|
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should initialize a new view" do
|
87
|
-
CouchDB::Design::View.should_receive(:new).with("test_view", "test_map", "test_reduce").and_return(@view)
|
88
|
-
@design.views[
|
87
|
+
CouchDB::Design::View.should_receive(:new).with(@design, "test_view", "test_map", "test_reduce").and_return(@view)
|
88
|
+
@design.views[:test_view]
|
89
89
|
end
|
90
90
|
|
91
91
|
it "should return the new view" do
|
92
|
-
@design.views[
|
92
|
+
@design.views[:test_view].should == @view
|
93
93
|
end
|
94
94
|
|
95
95
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Philipp Br\xC3\xBCll"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-13 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|