Skip to content

Commit

Permalink
Fix date handling test by should
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Oct 3, 2012
1 parent 25a0900 commit bd02687
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -21,7 +21,7 @@
"each": "latest",
"mecano": "latest",
"mocha": "latest",
"should": "0.6.0"
"should": "latest"
},
"contributors": [
{ "name": "David Worms", "email": "david@adaltas.com" }
Expand Down
18 changes: 9 additions & 9 deletions test/schema_temporal.coffee
Expand Up @@ -28,10 +28,10 @@ describe 'type', ->
should.not.exist err
# should v0.6.3 is broken with "instanceof Date"
# https://github.com/visionmedia/should.js/issues/65
# (record.cdate instanceof Date).should.be.true
# (record.mdate instanceof Date).should.be.true
record.cdate.should.be.an.instanceof Date
record.mdate.should.be.an.instanceof Date
(record.cdate instanceof Date).should.be.true
(record.mdate instanceof Date).should.be.true
# record.cdate.should.be.an.instanceof Date
# record.mdate.should.be.an.instanceof Date
next()

it 'should deal with update', (next) ->
Expand All @@ -48,10 +48,10 @@ describe 'type', ->
should.not.exist err
# should v0.6.3 is broken with "instanceof Date"
# https://github.com/visionmedia/should.js/issues/65
(record.cdate instanceof Date).should.be.true
(record.mdate instanceof Date).should.be.true
# record.cdate.should.be.an.instanceof Date
# record.mdate.should.be.an.instanceof Date
# (record.cdate is cdate).should.be.true
# (record.cdate instanceof Date).should.be.true
# (record.mdate instanceof Date).should.be.true
record.cdate.should.eql cdate
record.cdate.should.be.an.instanceof Date
record.mdate.should.be.an.instanceof Date
record.cdate.getTime().should.eql cdate.getTime()
next()
10 changes: 5 additions & 5 deletions test/type_date.coffee
Expand Up @@ -75,27 +75,27 @@ describe 'type date', ->
, (err, record) ->
should.not.exist err
recordId = record.record_id
record.a_date.should.eql date
record.a_date.getTime().should.eql date.getTime()
# Test all
Records.all (err, records) ->
should.not.exist err
records.length.should.equal 1
records[0].a_date.should.eql date
records[0].a_date.getTime().should.eql date.getTime()
# Test update
date.setYear 2010
Records.update
record_id: recordId
a_date: date
, (err, record) ->
should.not.exist err
record.a_date.should.eql date
record.a_date.getTime().should.eql date.getTime()
# Test list
Records.list (err, records) ->
should.not.exist err
records.length.should.equal 1
records[0].a_date.should.eql date
records[0].a_date.getTime().should.eql date.getTime()
# Test list
Records.get records[0].record_id, (err, record) ->
should.not.exist err
record.a_date.should.eql date
record.a_date.getTime().should.eql date.getTime()
next()

0 comments on commit bd02687

Please sign in to comment.