Ignore:
Timestamp:
03/14/14 12:36:58 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Enable deployment with Grunt.

Location:
Dev/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk

    • Property svn:ignore
      •  

        old new  
        11build
        2 quod-erat.git
  • Dev/trunk/node_modules/should/should.js

    r484 r516  
    189189};
    190190
    191 should.inspect = function(obj, opts) {
    192   if(util.isDate(obj) && typeof obj.inspect !== 'function') obj = obj.toISOString();
    193   return inspect(obj, opts);
    194 };
     191should.inspect = inspect;
     192
     193function i(value) {
     194  if(util.isDate(value) && typeof value.inspect !== 'function') return value.toISOString(); //show millis in dates
     195  return should.inspect(value);
     196}
    195197
    196198/**
     
    216218  if(null == obj) {
    217219    throw new AssertionError({
    218       message: msg || ('expected ' + should.inspect(obj) + ' to exist')
     220      message: msg || ('expected ' + i(obj) + ' to exist')
    219221      , stackStartFunction: should.exist
    220222    });
     
    234236  if (null != obj) {
    235237    throw new AssertionError({
    236       message: msg || ('expected ' + should.inspect(obj) + ' to not exist')
     238      message: msg || ('expected ' + i(obj) + ' to not exist')
    237239      , stackStartFunction: should.not.exist
    238240    });
     
    402404
    403405  get inspect() {
    404     return should.inspect(this.obj);
     406    return i(this.obj);
    405407  },
    406408
     
    532534    this.assert(
    533535        eql(val, this.obj)
    534       , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }
    535       , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }
     536      , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") }
     537      , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") }
    536538      , val
    537539      , true
     
    551553    this.assert(
    552554        val === this.obj
    553       , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }
    554       , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }
     555      , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") }
     556      , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") }
    555557      , val
    556558      , void 0
     
    804806    if (this.negate && undefined !== val) {
    805807      if (undefined === this.obj[name]) {
    806         throw new Error(this.inspect + ' has no property ' + should.inspect(name) + (description ? " | " + description : ""));
     808        throw new Error(this.inspect + ' has no property ' + i(name) + (description ? " | " + description : ""));
    807809      }
    808810    } else {
    809811      this.assert(
    810812          undefined !== this.obj[name]
    811         , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name) + (description ? " | " + description : "") }
    812         , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + (description ? " | " + description : "") }
     813        , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) + (description ? " | " + description : "") }
     814        , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + (description ? " | " + description : "") }
    813815        , void 0
    814816        , void 0
     
    819821      this.assert(
    820822          val === this.obj[name]
    821         , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name)
    822           + ' of ' + should.inspect(val) + ', but got ' + should.inspect(this.obj[name]) + (description ? " | " + description : "") }
    823         , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + ' of ' + should.inspect(val) + (description ? " | " + description : "") }
     823        , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name)
     824          + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (description ? " | " + description : "") }
     825        , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (description ? " | " + description : "") }
    824826        , void 0
    825827        , void 0
     
    855857    if (len > 1) {
    856858      names = names.map(function(name){
    857         return should.inspect(name);
     859        return i(name);
    858860      });
    859861      var last = names.pop();
    860862      str = names.join(', ') + ', and ' + last;
    861863    } else {
    862       str = should.inspect(names[0]);
     864      str = i(names[0]);
    863865    }
    864866
     
    885887    this.assert(
    886888      hasOwnProperty.call(this.obj, name)
    887       , function(){ return 'expected ' + this.inspect + ' to have own property ' + should.inspect(name) + (description ? " | " + description : "") }
    888       , function(){ return 'expected ' + this.inspect + ' to not have own property ' + should.inspect(name) + (description ? " | " + description : "") }
     889      , function(){ return 'expected ' + this.inspect + ' to have own property ' + i(name) + (description ? " | " + description : "") }
     890      , function(){ return 'expected ' + this.inspect + ' to not have own property ' + i(name) + (description ? " | " + description : "") }
    889891      , void 0
    890892      , void 0
     
    903905  startWith: function(str, description) {
    904906    this.assert(0 === this.obj.indexOf(str)
    905     , function() { return 'expected ' + this.inspect + ' to start with ' + should.inspect(str) + (description ? " | " + description : "") }
    906     , function() { return 'expected ' + this.inspect + ' to not start with ' + should.inspect(str) + (description ? " | " + description : "") }
     907    , function() { return 'expected ' + this.inspect + ' to start with ' + i(str) + (description ? " | " + description : "") }
     908    , function() { return 'expected ' + this.inspect + ' to not start with ' + i(str) + (description ? " | " + description : "") }
    907909    , void 0
    908910    , void 0
     
    920922  endWith: function(str, description) {
    921923    this.assert(-1 !== this.obj.indexOf(str, this.obj.length - str.length)
    922     , function() { return 'expected ' + this.inspect + ' to end with ' + should.inspect(str) + (description ? " | " + description : "") }
    923     , function() { return 'expected ' + this.inspect + ' to not end with ' + should.inspect(str) + (description ? " | " + description : "") }
     924    , function() { return 'expected ' + this.inspect + ' to end with ' + i(str) + (description ? " | " + description : "") }
     925    , function() { return 'expected ' + this.inspect + ' to not end with ' + i(str) + (description ? " | " + description : "") }
    924926    , void 0
    925927    , void 0
     
    942944      this.assert(
    943945          eql(cmp, obj)
    944         , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
    945         , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
     946        , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") }
     947        , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") }
    946948        , void 0
    947949        , void 0
     
    950952      this.assert(
    951953          ~this.obj.indexOf(obj)
    952         , function(){ return 'expected ' + this.inspect + ' to include ' + should.inspect(obj) + (description ? " | " + description : "") }
    953         , function(){ return 'expected ' + this.inspect + ' to not include ' + should.inspect(obj) + (description ? " | " + description : "") }
     954        , function(){ return 'expected ' + this.inspect + ' to include ' + i(obj) + (description ? " | " + description : "") }
     955        , function(){ return 'expected ' + this.inspect + ' to not include ' + i(obj) + (description ? " | " + description : "") }
    954956        , void 0
    955957        , void 0
     
    970972    this.assert(
    971973      this.obj.some(function(item) { return eql(obj, item); })
    972       , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
    973       , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
     974      , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") }
     975      , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") }
    974976      , void 0
    975977      , void 0
     
    10101012    if (len > 1) {
    10111013      keys = keys.map(function(key){
    1012         return should.inspect(key);
     1014        return i(key);
    10131015      });
    10141016      var last = keys.pop();
    10151017      str = keys.join(', ') + ', and ' + last;
    10161018    } else {
    1017       str = should.inspect(keys[0]);
     1019      str = i(keys[0]);
    10181020    }
    10191021
     
    10591061    this.assert(
    10601062        code == status
    1061       , function(){ return 'expected response code of ' + code + ' ' + should.inspect(statusCodes[code])
    1062         + ', but got ' + status + ' ' + should.inspect(statusCodes[status]) }
    1063       , function(){ return 'expected to not respond with ' + code + ' ' + should.inspect(statusCodes[code]) });
     1063      , function(){ return 'expected response code of ' + code + ' ' + i(statusCodes[code])
     1064        + ', but got ' + status + ' ' + i(statusCodes[status]) }
     1065      , function(){ return 'expected to not respond with ' + code + ' ' + i(statusCodes[code]) });
    10641066
    10651067    return this;
Note: See TracChangeset for help on using the changeset viewer.