Sha256: 3048bbee55a3eefe05d2f54d3575264e911dcebb29fd85d1fed8c93ba76d54ba

Contents?: true

Size: 612 Bytes

Versions: 5

Compression:

Stored size: 612 Bytes

Contents

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

describe CouchPotato::Database, 'new' do
  it "should raise an exception if the database doesn't exist" do
    lambda {
      CouchPotato::Database.new CouchRest.database('couch_potato_invalid')
    }.should raise_error('Database \'couch_potato_invalid\' does not exist.')
  end
end

describe CouchPotato::Database, 'load' do
  it "should raise an exception if nil given" do
    db = CouchPotato::Database.new(stub('couchrest db', :info => nil))
    lambda {
      db.load nil
    }.should raise_error("Can't load a document without an id (got nil)")
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
langalex-couch_potato-0.2.3 spec/unit/database_spec.rb
langalex-couch_potato-0.2.4 spec/unit/database_spec.rb
langalex-couch_potato-0.2.5 spec/unit/database_spec.rb
langalex-couch_potato-0.2.6 spec/unit/database_spec.rb
thefool808-couch_potato-0.2.7 spec/unit/database_spec.rb