blob: e1058fbdce42b22cef0078c65afad14fd9c49564 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/**
* Test that db.eval does not support auth.
*/
(function() {
'use strict';
assert.writeOK(db.evalprep.insert({}), "db must exist for eval to succeed");
assert(db.evalprep.drop());
// The db.auth method call getMongo().auth but catches the exception.
assert.eq(0, db.eval('db.auth("reader", "reader")'));
// Call the native implementation auth function and verify it does not exist under the db.eval
// javascript context.
assert.throws(function() {
db.eval('db.getMongo().auth("reader", "reader")');
});
})();
|