Sha256: 4cf50f8e8bcbf355e55a701783718bcd7ab460a572826d04a3dcb84bf045ece9

Contents?: true

Size: 764 Bytes

Versions: 6

Compression:

Stored size: 764 Bytes

Contents

require 'test_helper'

class Address; end

class MongoMapperTest < Test::Unit::TestCase  
  should "be able to write and read connection" do
    conn = Mongo::Connection.new
    MongoMapper.connection = conn
    MongoMapper.connection.should == conn
  end
  
  should "default connection to new mongo ruby driver" do
    MongoMapper.connection = nil
    MongoMapper.connection.should be_instance_of(Mongo::Connection)
  end
  
  should "be able to write and read default database" do
    MongoMapper.database = 'test'
    MongoMapper.database.should be_instance_of(Mongo::DB)
    MongoMapper.database.name.should == 'test'
  end
  
  should "have document not found error" do
    lambda {
      MongoMapper::DocumentNotFound
    }.should_not raise_error
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
mongo_mapper-unstable-2009.11.8 test/unit/test_mongomapper.rb
mongo_mapper-unstable-2009.11.6 test/unit/test_mongomapper.rb
djsun-mongo_mapper-0.5.8.2 test/unit/test_mongomapper.rb
djsun-mongo_mapper-0.5.8.1 test/unit/test_mongomapper.rb
mongo_mapper-unstable-2009.11.2 test/unit/test_mongomapper.rb
mongo_mapper-unstable-2009.10.31 test/unit/test_mongomapper.rb