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/lib/should.js

    r484 r516  
    2525};
    2626
    27 should.inspect = function(obj, opts) {
    28   if(util.isDate(obj) && typeof obj.inspect !== 'function') obj = obj.toISOString();
    29   return inspect(obj, opts);
    30 };
     27should.inspect = inspect;
     28
     29function i(value) {
     30  if(util.isDate(value) && typeof value.inspect !== 'function') return value.toISOString(); //show millis in dates
     31  return should.inspect(value);
     32}
    3133
    3234/**
     
    5254  if(null == obj) {
    5355    throw new AssertionError({
    54       message: msg || ('expected ' + should.inspect(obj) + ' to exist')
     56      message: msg || ('expected ' + i(obj) + ' to exist')
    5557      , stackStartFunction: should.exist
    5658    });
     
    7072  if (null != obj) {
    7173    throw new AssertionError({
    72       message: msg || ('expected ' + should.inspect(obj) + ' to not exist')
     74      message: msg || ('expected ' + i(obj) + ' to not exist')
    7375      , stackStartFunction: should.not.exist
    7476    });
     
    238240
    239241  get inspect() {
    240     return should.inspect(this.obj);
     242    return i(this.obj);
    241243  },
    242244
     
    368370    this.assert(
    369371        eql(val, this.obj)
    370       , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }
    371       , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }
     372      , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") }
     373      , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") }
    372374      , val
    373375      , true
     
    387389    this.assert(
    388390        val === this.obj
    389       , function(){ return 'expected ' + this.inspect + ' to equal ' + should.inspect(val) + (description ? " | " + description : "") }
    390       , function(){ return 'expected ' + this.inspect + ' to not equal ' + should.inspect(val) + (description ? " | " + description : "") }
     391      , function(){ return 'expected ' + this.inspect + ' to equal ' + i(val) + (description ? " | " + description : "") }
     392      , function(){ return 'expected ' + this.inspect + ' to not equal ' + i(val) + (description ? " | " + description : "") }
    391393      , val
    392394      , void 0
     
    640642    if (this.negate && undefined !== val) {
    641643      if (undefined === this.obj[name]) {
    642         throw new Error(this.inspect + ' has no property ' + should.inspect(name) + (description ? " | " + description : ""));
     644        throw new Error(this.inspect + ' has no property ' + i(name) + (description ? " | " + description : ""));
    643645      }
    644646    } else {
    645647      this.assert(
    646648          undefined !== this.obj[name]
    647         , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name) + (description ? " | " + description : "") }
    648         , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + (description ? " | " + description : "") }
     649        , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name) + (description ? " | " + description : "") }
     650        , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + (description ? " | " + description : "") }
    649651        , void 0
    650652        , void 0
     
    655657      this.assert(
    656658          val === this.obj[name]
    657         , function(){ return 'expected ' + this.inspect + ' to have a property ' + should.inspect(name)
    658           + ' of ' + should.inspect(val) + ', but got ' + should.inspect(this.obj[name]) + (description ? " | " + description : "") }
    659         , function(){ return 'expected ' + this.inspect + ' to not have a property ' + should.inspect(name) + ' of ' + should.inspect(val) + (description ? " | " + description : "") }
     659        , function(){ return 'expected ' + this.inspect + ' to have a property ' + i(name)
     660          + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (description ? " | " + description : "") }
     661        , function(){ return 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (description ? " | " + description : "") }
    660662        , void 0
    661663        , void 0
     
    691693    if (len > 1) {
    692694      names = names.map(function(name){
    693         return should.inspect(name);
     695        return i(name);
    694696      });
    695697      var last = names.pop();
    696698      str = names.join(', ') + ', and ' + last;
    697699    } else {
    698       str = should.inspect(names[0]);
     700      str = i(names[0]);
    699701    }
    700702
     
    721723    this.assert(
    722724      hasOwnProperty.call(this.obj, name)
    723       , function(){ return 'expected ' + this.inspect + ' to have own property ' + should.inspect(name) + (description ? " | " + description : "") }
    724       , function(){ return 'expected ' + this.inspect + ' to not have own property ' + should.inspect(name) + (description ? " | " + description : "") }
     725      , function(){ return 'expected ' + this.inspect + ' to have own property ' + i(name) + (description ? " | " + description : "") }
     726      , function(){ return 'expected ' + this.inspect + ' to not have own property ' + i(name) + (description ? " | " + description : "") }
    725727      , void 0
    726728      , void 0
     
    739741  startWith: function(str, description) {
    740742    this.assert(0 === this.obj.indexOf(str)
    741     , function() { return 'expected ' + this.inspect + ' to start with ' + should.inspect(str) + (description ? " | " + description : "") }
    742     , function() { return 'expected ' + this.inspect + ' to not start with ' + should.inspect(str) + (description ? " | " + description : "") }
     743    , function() { return 'expected ' + this.inspect + ' to start with ' + i(str) + (description ? " | " + description : "") }
     744    , function() { return 'expected ' + this.inspect + ' to not start with ' + i(str) + (description ? " | " + description : "") }
    743745    , void 0
    744746    , void 0
     
    756758  endWith: function(str, description) {
    757759    this.assert(-1 !== this.obj.indexOf(str, this.obj.length - str.length)
    758     , function() { return 'expected ' + this.inspect + ' to end with ' + should.inspect(str) + (description ? " | " + description : "") }
    759     , function() { return 'expected ' + this.inspect + ' to not end with ' + should.inspect(str) + (description ? " | " + description : "") }
     760    , function() { return 'expected ' + this.inspect + ' to end with ' + i(str) + (description ? " | " + description : "") }
     761    , function() { return 'expected ' + this.inspect + ' to not end with ' + i(str) + (description ? " | " + description : "") }
    760762    , void 0
    761763    , void 0
     
    778780      this.assert(
    779781          eql(cmp, obj)
    780         , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
    781         , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
     782        , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") }
     783        , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") }
    782784        , void 0
    783785        , void 0
     
    786788      this.assert(
    787789          ~this.obj.indexOf(obj)
    788         , function(){ return 'expected ' + this.inspect + ' to include ' + should.inspect(obj) + (description ? " | " + description : "") }
    789         , function(){ return 'expected ' + this.inspect + ' to not include ' + should.inspect(obj) + (description ? " | " + description : "") }
     790        , function(){ return 'expected ' + this.inspect + ' to include ' + i(obj) + (description ? " | " + description : "") }
     791        , function(){ return 'expected ' + this.inspect + ' to not include ' + i(obj) + (description ? " | " + description : "") }
    790792        , void 0
    791793        , void 0
     
    806808    this.assert(
    807809      this.obj.some(function(item) { return eql(obj, item); })
    808       , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
    809       , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + should.inspect(obj) + (description ? " | " + description : "") }
     810      , function(){ return 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (description ? " | " + description : "") }
     811      , function(){ return 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (description ? " | " + description : "") }
    810812      , void 0
    811813      , void 0
     
    846848    if (len > 1) {
    847849      keys = keys.map(function(key){
    848         return should.inspect(key);
     850        return i(key);
    849851      });
    850852      var last = keys.pop();
    851853      str = keys.join(', ') + ', and ' + last;
    852854    } else {
    853       str = should.inspect(keys[0]);
     855      str = i(keys[0]);
    854856    }
    855857
     
    895897    this.assert(
    896898        code == status
    897       , function(){ return 'expected response code of ' + code + ' ' + should.inspect(statusCodes[code])
    898         + ', but got ' + status + ' ' + should.inspect(statusCodes[status]) }
    899       , function(){ return 'expected to not respond with ' + code + ' ' + should.inspect(statusCodes[code]) });
     899      , function(){ return 'expected response code of ' + code + ' ' + i(statusCodes[code])
     900        + ', but got ' + status + ' ' + i(statusCodes[status]) }
     901      , function(){ return 'expected to not respond with ' + code + ' ' + i(statusCodes[code]) });
    900902
    901903    return this;
Note: See TracChangeset for help on using the changeset viewer.