Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for passing a date as the expiry to set

  • Loading branch information...
commit 0e722c7fe428bee9e99dd6df037cca8662f748c4 1 parent 1165953
@wezm authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/db_test.coffee
View
11 test/db_test.coffee
@@ -115,6 +115,17 @@ module.exports =
test.ok expires instanceof Date
test.done()
+ 'allows the expiry time to be specified as a date': (test) ->
+ test.expect 2
+ expiry = new Date()
+ expiry.setUTCFullYear(expiry.getUTCFullYear() + 1)
+ db.set 'test', 'Value', {expires: expiry}, (error, output) ->
+ test.ifError error
+
+ db.get 'test', (error, value, expires) ->
+ test.equal expires.toUTCString(), expiry.toUTCString()
+ test.done()
+
add: testCase
setUp: dbClear
Please sign in to comment.
Something went wrong with that request. Please try again.