added block yields to db.view

This commit is contained in:
Chris Anderson 2008-10-13 16:46:48 -07:00
parent b1847cb465
commit 54a0afdf8e
2 changed files with 14 additions and 2 deletions

View file

@ -117,6 +117,13 @@ describe CouchRest::Database do
rs = @db.view('first/test', :keys => ["another", "wild"])
rs['rows'].length.should == 2
end
it "should accept a block" do
rows = []
rs = @db.view('first/test', :include_docs => true) do |row|
rows << row
end
rows.length.should == 3
end
end
describe "GET (document by id) when the doc exists" do