Sha256: 9ba052edc633705cfeb8a4483da50849b8a26c87b746d448fea40f0b2a341432

Contents?: true

Size: 1.03 KB

Versions: 63

Compression:

Stored size: 1.03 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe CouchRest::Server do
  
  describe "available databases" do
    before(:each) do
      @couch = CouchRest::Server.new
    end

    after(:each) do
      @couch.available_databases.each do |ref, db|
        db.delete!
      end
    end
    
    it "should let you add more databases" do
      @couch.available_databases.should be_empty
      @couch.define_available_database(:default, "cr-server-test-db")
      @couch.available_databases.keys.should include(:default)
    end
    
    it "should verify that a database is available" do
      @couch.define_available_database(:default, "cr-server-test-db")
      @couch.available_database?(:default).should be_true
      @couch.available_database?("cr-server-test-db").should be_true
      @couch.available_database?(:matt).should be_false
    end
    
    it "should let you set a default database" do
      @couch.default_database = 'cr-server-test-default-db'
      @couch.available_database?(:default).should be_true
    end
  end
  
end

Version data entries

63 entries across 63 versions & 19 rubygems

Version Path
brianmario-couchrest-0.23 spec/couchrest/core/server_spec.rb
glasner-couchrest-0.2.2 spec/couchrest/core/server_spec.rb
gohanlonllc-couchrest-0.2.3.1 spec/couchrest/core/server_spec.rb
halfninja-couchrest-0.23.2 spec/couchrest/core/server_spec.rb
halfninja-couchrest-0.23.3 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.16 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.17.0 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.2.1 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.2.2 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.2 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.22 spec/couchrest/core/server_spec.rb
jchris-couchrest-0.23 spec/couchrest/core/server_spec.rb
jkestr-couchrest-0.23 spec/couchrest/core/server_spec.rb
jpbougie-couchrest-0.27 spec/couchrest/core/server_spec.rb
jrun-couchrest-0.17.1 spec/couchrest/core/server_spec.rb
jrun-couchrest-0.2.1.1 spec/couchrest/core/server_spec.rb
jrun-couchrest-0.2.1 spec/couchrest/core/server_spec.rb
mattetti-couchrest-0.13.1 spec/couchrest/core/server_spec.rb
mattetti-couchrest-0.13.2 spec/couchrest/core/server_spec.rb
mattetti-couchrest-0.13.3 spec/couchrest/core/server_spec.rb