print nothing if tests does not exist

This commit is contained in:
Jim Menard 2009-02-05 15:59:09 -05:00
parent 21daa03a2f
commit 7a41f5be82
2 changed files with 4 additions and 20 deletions

View File

@ -5,6 +5,10 @@
HERE=`dirname $0`
if [ ! -f $HERE/../tests/mongo-qa/$1 ] ; then
exit 0
fi
begintime=`date`
ruby $HERE/../tests/mongo-qa/$1 >> $2
exitval=$?

View File

@ -1,20 +0,0 @@
#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), '_common.rb')
db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
if __FILE__ == $0
%w(a b c).each { |name| db.drop_collection(name) }
end
colla = db.collection('a')
collb = db.collection('b')
collc = db.collection('c')
colla.insert('c' => 'b')
collb.insert('c' => 1)
x_id = ObjectID.new
x_dbref = DBRef.new(nil, 'thiz', db, 'c', x_id)
x = {'_id' => x_id, 'that' => 2, 'thiz' => x_dbref}
collc.insert(x)