Sha256: c6b0a14fd3252147ed57662384ade256acf4ccb1ce8d72a23a0a8b2f2f38eaf7
Contents?: true
Size: 1.63 KB
Versions: 2
Compression:
Stored size: 1.63 KB
Contents
require File.dirname(__FILE__) + '/spec_helper' describe CouchRest do before(:each) do @cr = CouchRest.new(COUCHHOST) begin @db = @cr.database(TESTDB) @db.delete! rescue nil end end after(:each) do begin @db.delete! rescue nil end end describe "getting info" do it "should list databases" do @cr.databases.should be_an_instance_of(Array) end it "should get info" do @cr.info["couchdb"].should == "Welcome" @cr.info.class.should == Hash end end describe "description" do it "should restart" do @cr.restart! end end describe "initializing a database" do it "should return a db" do db = @cr.database(TESTDB) db.should be_an_instance_of(CouchRest::Database) db.host.should == @cr.uri end end describe "successfully creating a database" do it "should start without a database" do @cr.databases.should_not include(TESTDB) end it "should return the created database" do db = @cr.create_db(TESTDB) db.should be_an_instance_of(CouchRest::Database) end it "should create the database" do db = @cr.create_db(TESTDB) @cr.databases.should include(TESTDB) end end describe "failing to create a database because the name is taken" do before(:each) do db = @cr.create_db(TESTDB) end it "should start with the test database" do @cr.databases.should include(TESTDB) end it "should PUT the database and raise an error" do lambda{ @cr.create_db(TESTDB) }.should raise_error(RestClient::Request::RequestFailed) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jchris-couchrest-0.9.0 | spec/couchrest_spec.rb |
jchris-couchrest-0.9.1 | spec/couchrest_spec.rb |