stylus-source 0.28.2 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. data/VERSION +1 -1
  2. data/vendor/Readme.md +1 -1
  3. data/vendor/lib/functions/index.js +75 -1
  4. data/vendor/lib/functions/url.js +11 -12
  5. data/vendor/lib/lexer.js +2 -1
  6. data/vendor/lib/stylus.js +1 -1
  7. data/vendor/lib/visitor/compiler.js +1 -1
  8. data/vendor/lib/visitor/evaluator.js +2 -0
  9. data/vendor/node_modules/cssom/package.json +0 -3
  10. data/vendor/node_modules/mocha/History.md +21 -0
  11. data/vendor/node_modules/mocha/Makefile +2 -2
  12. data/vendor/node_modules/mocha/_mocha.js +141 -48
  13. data/vendor/node_modules/mocha/bin/_mocha +53 -61
  14. data/vendor/node_modules/mocha/bin/mocha +3 -0
  15. data/vendor/node_modules/mocha/lib/interfaces/bdd.js +23 -6
  16. data/vendor/node_modules/mocha/lib/mocha.js +55 -4
  17. data/vendor/node_modules/mocha/lib/reporters/base.js +5 -5
  18. data/vendor/node_modules/mocha/lib/reporters/dot.js +5 -4
  19. data/vendor/node_modules/mocha/lib/reporters/html.js +25 -12
  20. data/vendor/node_modules/mocha/lib/reporters/landing.js +2 -2
  21. data/vendor/node_modules/mocha/lib/reporters/min.js +2 -2
  22. data/vendor/node_modules/mocha/lib/reporters/nyan.js +6 -6
  23. data/vendor/node_modules/mocha/lib/reporters/progress.js +1 -1
  24. data/vendor/node_modules/mocha/lib/reporters/xunit.js +5 -1
  25. data/vendor/node_modules/mocha/lib/runnable.js +1 -1
  26. data/vendor/node_modules/mocha/lib/runner.js +3 -3
  27. data/vendor/node_modules/mocha/lib/suite.js +7 -1
  28. data/vendor/node_modules/mocha/lib/utils.js +1 -1
  29. data/vendor/node_modules/mocha/mocha.css +18 -1
  30. data/vendor/node_modules/mocha/mocha.js +141 -48
  31. data/vendor/node_modules/mocha/package.json +6 -3
  32. data/vendor/node_modules/mocha/test.js +3 -5
  33. data/vendor/node_modules/should/History.md +11 -0
  34. data/vendor/node_modules/should/Readme.md +22 -10
  35. data/vendor/node_modules/should/lib/should.js +70 -62
  36. data/vendor/node_modules/should/package.json +5 -2
  37. data/vendor/node_modules/should/test/should.test.js +64 -0
  38. data/vendor/package.json +1 -1
  39. data/vendor/testing/foo.css +3 -0
  40. data/vendor/testing/index.js +1 -0
  41. data/vendor/testing/small.styl +12 -10
  42. metadata +3 -16
  43. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet +0 -16
  44. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet +0 -16
  45. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet +0 -16
  46. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet +0 -16
  47. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet +0 -16
  48. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet +0 -16
  49. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/info.plist +0 -19
  50. data/vendor/node_modules/mocha/support/compile.js +0 -154
  51. data/vendor/node_modules/mocha/support/foot.js +0 -1
  52. data/vendor/node_modules/mocha/support/head.js +0 -2
  53. data/vendor/node_modules/mocha/support/tail.js +0 -150
  54. data/vendor/node_modules/mocha/support/template.html +0 -16
@@ -537,11 +537,6 @@ module.exports = function(suite){
537
537
 
538
538
  suite.on('pre-require', function(context){
539
539
 
540
- // noop variants
541
-
542
- context.xdescribe = function(){};
543
- context.xit = function(){};
544
-
545
540
  /**
546
541
  * Execute before running tests.
547
542
  */
@@ -574,6 +569,18 @@ module.exports = function(suite){
574
569
  suites[0].afterEach(fn);
575
570
  };
576
571
 
572
+ /**
573
+ * Pending describe.
574
+ */
575
+
576
+ context.xdescribe = context.xcontext = function(title, fn){
577
+ var suite = Suite.create(suites[0], title);
578
+ suite.pending = true;
579
+ suites.unshift(suite);
580
+ fn();
581
+ suites.shift();
582
+ };
583
+
577
584
  /**
578
585
  * Describe a "suite" with the given `title`
579
586
  * and callback `fn` containing nested suites
@@ -594,7 +601,17 @@ module.exports = function(suite){
594
601
  */
595
602
 
596
603
  context.it = context.specify = function(title, fn){
597
- suites[0].addTest(new Test(title, fn));
604
+ var suite = suites[0];
605
+ if (suite.pending) var fn = null;
606
+ suite.addTest(new Test(title, fn));
607
+ };
608
+
609
+ /**
610
+ * Pending test case.
611
+ */
612
+
613
+ context.xit = context.xspecify = function(title){
614
+ context.it(title);
598
615
  };
599
616
  });
600
617
  };
@@ -985,13 +1002,15 @@ Mocha.prototype.ui = function(name){
985
1002
  * @api private
986
1003
  */
987
1004
 
988
- Mocha.prototype.loadFiles = function(){
1005
+ Mocha.prototype.loadFiles = function(fn){
989
1006
  var suite = this.suite;
1007
+ var pending = this.files.length;
990
1008
  this.files.forEach(function(file){
991
1009
  file = path.resolve(file);
992
1010
  suite.emit('pre-require', global, file);
993
1011
  suite.emit('require', require(file), file);
994
1012
  suite.emit('post-require', global, file);
1013
+ --pending || (fn && fn());
995
1014
  });
996
1015
  };
997
1016
 
@@ -1001,7 +1020,7 @@ Mocha.prototype.loadFiles = function(){
1001
1020
  * @api private
1002
1021
  */
1003
1022
 
1004
- Mocha.prototype.growl = function(runner, reporter) {
1023
+ Mocha.prototype._growl = function(runner, reporter) {
1005
1024
  var notify = require('growl');
1006
1025
 
1007
1026
  runner.on('end', function(){
@@ -1034,6 +1053,55 @@ Mocha.prototype.grep = function(re){
1034
1053
  return this;
1035
1054
  };
1036
1055
 
1056
+ /**
1057
+ * Invert `.grep()` matches.
1058
+ *
1059
+ * @return {Mocha}
1060
+ * @api public
1061
+ */
1062
+
1063
+ Mocha.prototype.invert = function(){
1064
+ this.options.invert = true;
1065
+ return this;
1066
+ };
1067
+
1068
+ /**
1069
+ * Ignore global leaks.
1070
+ *
1071
+ * @return {Mocha}
1072
+ * @api public
1073
+ */
1074
+
1075
+ Mocha.prototype.ignoreLeaks = function(){
1076
+ this.options.ignoreLeaks = true;
1077
+ return this;
1078
+ };
1079
+
1080
+ /**
1081
+ * Enable growl support.
1082
+ *
1083
+ * @return {Mocha}
1084
+ * @api public
1085
+ */
1086
+
1087
+ Mocha.prototype.growl = function(){
1088
+ this.options.growl = true;
1089
+ return this;
1090
+ };
1091
+
1092
+ /**
1093
+ * Ignore `globals`.
1094
+ *
1095
+ * @param {Array} globals
1096
+ * @return {Mocha}
1097
+ * @api public
1098
+ */
1099
+
1100
+ Mocha.prototype.globals = function(globals){
1101
+ this.options.globals = globals;
1102
+ return this;
1103
+ };
1104
+
1037
1105
  /**
1038
1106
  * Run tests and invoke `fn()` when complete.
1039
1107
  *
@@ -1049,9 +1117,9 @@ Mocha.prototype.run = function(fn){
1049
1117
  var runner = new exports.Runner(suite);
1050
1118
  var reporter = new this._reporter(runner);
1051
1119
  runner.ignoreLeaks = options.ignoreLeaks;
1052
- if (options.grep) runner.grep(options.grep);
1120
+ if (options.grep) runner.grep(options.grep, options.invert);
1053
1121
  if (options.globals) runner.globals(options.globals);
1054
- if (options.growl) this.growl(runner, reporter);
1122
+ if (options.growl) this._growl(runner, reporter);
1055
1123
  return runner.run(fn);
1056
1124
  };
1057
1125
 
@@ -1134,7 +1202,7 @@ exports.colors = {
1134
1202
 
1135
1203
  var color = exports.color = function(type, str) {
1136
1204
  if (!exports.useColors) return str;
1137
- return '\033[' + exports.colors[type] + 'm' + str + '\033[0m';
1205
+ return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
1138
1206
  };
1139
1207
 
1140
1208
  /**
@@ -1157,19 +1225,19 @@ exports.window = {
1157
1225
 
1158
1226
  exports.cursor = {
1159
1227
  hide: function(){
1160
- process.stdout.write('\033[?25l');
1228
+ process.stdout.write('\u001b[?25l');
1161
1229
  },
1162
1230
 
1163
1231
  show: function(){
1164
- process.stdout.write('\033[?25h');
1232
+ process.stdout.write('\u001b[?25h');
1165
1233
  },
1166
1234
 
1167
1235
  deleteLine: function(){
1168
- process.stdout.write('\033[2K');
1236
+ process.stdout.write('\u001b[2K');
1169
1237
  },
1170
1238
 
1171
1239
  beginningOfLine: function(){
1172
- process.stdout.write('\033[0G');
1240
+ process.stdout.write('\u001b[0G');
1173
1241
  },
1174
1242
 
1175
1243
  CR: function(){
@@ -1504,6 +1572,7 @@ function Dot(runner) {
1504
1572
  var self = this
1505
1573
  , stats = this.stats
1506
1574
  , width = Base.window.width * .75 | 0
1575
+ , c = '․'
1507
1576
  , n = 0;
1508
1577
 
1509
1578
  runner.on('start', function(){
@@ -1511,21 +1580,21 @@ function Dot(runner) {
1511
1580
  });
1512
1581
 
1513
1582
  runner.on('pending', function(test){
1514
- process.stdout.write(color('pending', '.'));
1583
+ process.stdout.write(color('pending', c));
1515
1584
  });
1516
1585
 
1517
1586
  runner.on('pass', function(test){
1518
1587
  if (++n % width == 0) process.stdout.write('\n ');
1519
1588
  if ('slow' == test.speed) {
1520
- process.stdout.write(color('bright yellow', '.'));
1589
+ process.stdout.write(color('bright yellow', c));
1521
1590
  } else {
1522
- process.stdout.write(color(test.speed, '.'));
1591
+ process.stdout.write(color(test.speed, c));
1523
1592
  }
1524
1593
  });
1525
1594
 
1526
1595
  runner.on('fail', function(test, err){
1527
1596
  if (++n % width == 0) process.stdout.write('\n ');
1528
- process.stdout.write(color('fail', '.'));
1597
+ process.stdout.write(color('fail', c));
1529
1598
  });
1530
1599
 
1531
1600
  runner.on('end', function(){
@@ -1630,8 +1699,8 @@ exports = module.exports = HTML;
1630
1699
 
1631
1700
  var statsTemplate = '<ul id="stats">'
1632
1701
  + '<li class="progress"><canvas width="40" height="40"></canvas></li>'
1633
- + '<li class="passes">passes: <em>0</em></li>'
1634
- + '<li class="failures">failures: <em>0</em></li>'
1702
+ + '<li class="passes"><a href="#">passes:</a> <em>0</em></li>'
1703
+ + '<li class="failures"><a href="#">failures:</a> <em>0</em></li>'
1635
1704
  + '<li class="duration">duration: <em>0</em>s</li>'
1636
1705
  + '</ul>';
1637
1706
 
@@ -1652,7 +1721,9 @@ function HTML(runner) {
1652
1721
  , stat = fragment(statsTemplate)
1653
1722
  , items = stat.getElementsByTagName('li')
1654
1723
  , passes = items[1].getElementsByTagName('em')[0]
1724
+ , passesLink = items[1].getElementsByTagName('a')[0]
1655
1725
  , failures = items[2].getElementsByTagName('em')[0]
1726
+ , failuresLink = items[2].getElementsByTagName('a')[0]
1656
1727
  , duration = items[3].getElementsByTagName('em')[0]
1657
1728
  , canvas = stat.getElementsByTagName('canvas')[0]
1658
1729
  , report = fragment('<ul id="report"></ul>')
@@ -1667,6 +1738,18 @@ function HTML(runner) {
1667
1738
 
1668
1739
  if (!root) return error('#mocha div missing, add it to your document');
1669
1740
 
1741
+ // pass toggle
1742
+ on(passesLink, 'click', function () {
1743
+ var className = /pass/.test(report.className) ? '' : ' pass';
1744
+ report.className = report.className.replace(/fail|pass/g, '') + className;
1745
+ });
1746
+
1747
+ // failure toggle
1748
+ on(failuresLink, 'click', function () {
1749
+ var className = /fail/.test(report.className) ? '' : ' fail';
1750
+ report.className = report.className.replace(/fail|pass/g, '') + className;
1751
+ });
1752
+
1670
1753
  root.appendChild(stat);
1671
1754
  root.appendChild(report);
1672
1755
 
@@ -1734,17 +1817,16 @@ function HTML(runner) {
1734
1817
  }
1735
1818
 
1736
1819
  // toggle code
1737
- var h2 = el.getElementsByTagName('h2')[0];
1738
-
1739
- on(h2, 'click', function(){
1740
- pre.style.display = 'none' == pre.style.display
1741
- ? 'block'
1742
- : 'none';
1743
- });
1744
-
1745
- // code
1746
1820
  // TODO: defer
1747
1821
  if (!test.pending) {
1822
+ var h2 = el.getElementsByTagName('h2')[0];
1823
+
1824
+ on(h2, 'click', function(){
1825
+ pre.style.display = 'none' == pre.style.display
1826
+ ? 'inline-block'
1827
+ : 'none';
1828
+ });
1829
+
1748
1830
  var pre = fragment('<pre><code>%e</code></pre>', utils.clean(test.fn.toString()));
1749
1831
  el.appendChild(pre);
1750
1832
  pre.style.display = 'none';
@@ -1804,6 +1886,7 @@ function on(el, event, fn) {
1804
1886
  el.attachEvent('on' + event, fn);
1805
1887
  }
1806
1888
  }
1889
+
1807
1890
  }); // module: reporters/html.js
1808
1891
 
1809
1892
  require.register("reporters/index.js", function(module, exports, require){
@@ -2194,14 +2277,14 @@ function Landing(runner) {
2194
2277
  }
2195
2278
 
2196
2279
  // render landing strip
2197
- stream.write('\033[4F\n\n');
2280
+ stream.write('\u001b[4F\n\n');
2198
2281
  stream.write(runway());
2199
2282
  stream.write('\n ');
2200
2283
  stream.write(color('runway', Array(col).join('⋅')));
2201
2284
  stream.write(plane)
2202
2285
  stream.write(color('runway', Array(width - col).join('⋅') + '\n'));
2203
2286
  stream.write(runway());
2204
- stream.write('\033[0m');
2287
+ stream.write('\u001b[0m');
2205
2288
  });
2206
2289
 
2207
2290
  runner.on('end', function(){
@@ -2411,9 +2494,9 @@ function Min(runner) {
2411
2494
 
2412
2495
  runner.on('start', function(){
2413
2496
  // clear screen
2414
- process.stdout.write('\033[2J');
2497
+ process.stdout.write('\u001b[2J');
2415
2498
  // set cursor position
2416
- process.stdout.write('\033[1;3H');
2499
+ process.stdout.write('\u001b[1;3H');
2417
2500
  });
2418
2501
 
2419
2502
  runner.on('end', this.epilogue.bind(this));
@@ -2518,7 +2601,7 @@ NyanCat.prototype.drawScoreboard = function(){
2518
2601
 
2519
2602
  function draw(color, n) {
2520
2603
  write(' ');
2521
- write('\033[' + color + 'm' + n + '\033[0m');
2604
+ write('\u001b[' + color + 'm' + n + '\u001b[0m');
2522
2605
  write('\n');
2523
2606
  }
2524
2607
 
@@ -2557,7 +2640,7 @@ NyanCat.prototype.drawRainbow = function(){
2557
2640
  var self = this;
2558
2641
 
2559
2642
  this.trajectories.forEach(function(line, index) {
2560
- write('\033[' + self.scoreboardWidth + 'C');
2643
+ write('\u001b[' + self.scoreboardWidth + 'C');
2561
2644
  write(line.join(''));
2562
2645
  write('\n');
2563
2646
  });
@@ -2577,7 +2660,7 @@ NyanCat.prototype.drawNyanCat = function(status) {
2577
2660
  var startWidth = this.scoreboardWidth + this.trajectories[0].length;
2578
2661
 
2579
2662
  [0, 1, 2, 3].forEach(function(index) {
2580
- write('\033[' + startWidth + 'C');
2663
+ write('\u001b[' + startWidth + 'C');
2581
2664
 
2582
2665
  switch (index) {
2583
2666
  case 0:
@@ -2625,7 +2708,7 @@ NyanCat.prototype.drawNyanCat = function(status) {
2625
2708
  */
2626
2709
 
2627
2710
  NyanCat.prototype.cursorUp = function(n) {
2628
- write('\033[' + n + 'A');
2711
+ write('\u001b[' + n + 'A');
2629
2712
  };
2630
2713
 
2631
2714
  /**
@@ -2636,7 +2719,7 @@ NyanCat.prototype.cursorUp = function(n) {
2636
2719
  */
2637
2720
 
2638
2721
  NyanCat.prototype.cursorDown = function(n) {
2639
- write('\033[' + n + 'B');
2722
+ write('\u001b[' + n + 'B');
2640
2723
  };
2641
2724
 
2642
2725
  /**
@@ -2672,7 +2755,7 @@ NyanCat.prototype.generateColors = function(){
2672
2755
  NyanCat.prototype.rainbowify = function(str){
2673
2756
  var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length];
2674
2757
  this.colorIndex += 1;
2675
- return '\033[38;5;' + color + 'm' + str + '\033[0m';
2758
+ return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m';
2676
2759
  };
2677
2760
 
2678
2761
  /**
@@ -2756,7 +2839,7 @@ function Progress(runner, options) {
2756
2839
  , i = width - n;
2757
2840
 
2758
2841
  cursor.CR();
2759
- process.stdout.write('\033[J');
2842
+ process.stdout.write('\u001b[J');
2760
2843
  process.stdout.write(color('progress', ' ' + options.open));
2761
2844
  process.stdout.write(Array(n).join(options.complete));
2762
2845
  process.stdout.write(Array(i).join(options.incomplete));
@@ -3053,7 +3136,11 @@ function XUnit(runner) {
3053
3136
  , tests = []
3054
3137
  , self = this;
3055
3138
 
3056
- runner.on('test end', function(test){
3139
+ runner.on('pass', function(test){
3140
+ tests.push(test);
3141
+ });
3142
+
3143
+ runner.on('fail', function(test){
3057
3144
  tests.push(test);
3058
3145
  });
3059
3146
 
@@ -3138,7 +3225,7 @@ require.register("runnable.js", function(module, exports, require){
3138
3225
  */
3139
3226
 
3140
3227
  var EventEmitter = require('browser/events').EventEmitter
3141
- , debug = require('browser/debug')('runnable');
3228
+ , debug = require('browser/debug')('mocha:runnable');
3142
3229
 
3143
3230
  /**
3144
3231
  * Save timer references to avoid Sinon interfering (see GH-237).
@@ -3334,7 +3421,7 @@ require.register("runner.js", function(module, exports, require){
3334
3421
  */
3335
3422
 
3336
3423
  var EventEmitter = require('browser/events').EventEmitter
3337
- , debug = require('browser/debug')('runner')
3424
+ , debug = require('browser/debug')('mocha:runner')
3338
3425
  , Test = require('./test')
3339
3426
  , utils = require('./utils')
3340
3427
  , filter = utils.filter
@@ -3743,9 +3830,9 @@ Runner.prototype.runSuite = function(suite, fn){
3743
3830
  */
3744
3831
 
3745
3832
  Runner.prototype.uncaught = function(err){
3746
- debug('uncaught exception');
3833
+ debug('uncaught exception %s', err.message);
3747
3834
  var runnable = this.currentRunnable;
3748
- if ('failed' == runnable.state) return;
3835
+ if (!runnable || 'failed' == runnable.state) return;
3749
3836
  runnable.clearTimeout();
3750
3837
  err.uncaught = true;
3751
3838
  this.fail(runnable, err);
@@ -3827,7 +3914,7 @@ require.register("suite.js", function(module, exports, require){
3827
3914
  */
3828
3915
 
3829
3916
  var EventEmitter = require('browser/events').EventEmitter
3830
- , debug = require('browser/debug')('suite')
3917
+ , debug = require('browser/debug')('mocha:suite')
3831
3918
  , utils = require('./utils')
3832
3919
  , Hook = require('./hook');
3833
3920
 
@@ -3853,6 +3940,7 @@ exports = module.exports = Suite;
3853
3940
  exports.create = function(parent, title){
3854
3941
  var suite = new Suite(title, parent.ctx);
3855
3942
  suite.parent = parent;
3943
+ if (parent.pending) suite.pending = true;
3856
3944
  title = suite.fullTitle();
3857
3945
  parent.addSuite(suite);
3858
3946
  return suite;
@@ -3872,6 +3960,7 @@ function Suite(title, ctx) {
3872
3960
  this.ctx = ctx;
3873
3961
  this.suites = [];
3874
3962
  this.tests = [];
3963
+ this.pending = false;
3875
3964
  this._beforeEach = [];
3876
3965
  this._beforeAll = [];
3877
3966
  this._afterEach = [];
@@ -3945,6 +4034,7 @@ Suite.prototype.bail = function(bail){
3945
4034
  */
3946
4035
 
3947
4036
  Suite.prototype.beforeAll = function(fn){
4037
+ if (this.pending) return this;
3948
4038
  var hook = new Hook('"before all" hook', fn);
3949
4039
  hook.parent = this;
3950
4040
  hook.timeout(this.timeout());
@@ -3963,6 +4053,7 @@ Suite.prototype.beforeAll = function(fn){
3963
4053
  */
3964
4054
 
3965
4055
  Suite.prototype.afterAll = function(fn){
4056
+ if (this.pending) return this;
3966
4057
  var hook = new Hook('"after all" hook', fn);
3967
4058
  hook.parent = this;
3968
4059
  hook.timeout(this.timeout());
@@ -3981,6 +4072,7 @@ Suite.prototype.afterAll = function(fn){
3981
4072
  */
3982
4073
 
3983
4074
  Suite.prototype.beforeEach = function(fn){
4075
+ if (this.pending) return this;
3984
4076
  var hook = new Hook('"before each" hook', fn);
3985
4077
  hook.parent = this;
3986
4078
  hook.timeout(this.timeout());
@@ -3999,6 +4091,7 @@ Suite.prototype.beforeEach = function(fn){
3999
4091
  */
4000
4092
 
4001
4093
  Suite.prototype.afterEach = function(fn){
4094
+ if (this.pending) return this;
4002
4095
  var hook = new Hook('"after each" hook', fn);
4003
4096
  hook.parent = this;
4004
4097
  hook.timeout(this.timeout());
@@ -4138,7 +4231,7 @@ require.register("utils.js", function(module, exports, require){
4138
4231
  var fs = require('browser/fs')
4139
4232
  , path = require('browser/path')
4140
4233
  , join = path.join
4141
- , debug = require('browser/debug')('watch');
4234
+ , debug = require('browser/debug')('mocha:watch');
4142
4235
 
4143
4236
  /**
4144
4237
  * Ignored directories.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocha",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "simple, flexible, fun test framework",
5
5
  "keywords": [
6
6
  "test",
@@ -25,7 +25,7 @@
25
25
  "node": ">= 0.4.x"
26
26
  },
27
27
  "scripts": {
28
- "test": "make test"
28
+ "test": "make test-all"
29
29
  },
30
30
  "dependencies": {
31
31
  "commander": "0.6.1",
@@ -38,11 +38,14 @@
38
38
  "should": "*",
39
39
  "coffee-script": "1.2"
40
40
  },
41
- "_id": "mocha@1.3.0",
41
+ "_id": "mocha@1.3.2",
42
42
  "optionalDependencies": {},
43
43
  "_engineSupported": true,
44
44
  "_npmVersion": "1.1.21",
45
45
  "_nodeVersion": "v0.8.1",
46
46
  "_defaultsLoaded": true,
47
+ "dist": {
48
+ "shasum": "ab97b4f1e5942b9fe4d4436b8bd9eeda0eb01e13"
49
+ },
47
50
  "_from": "mocha@*"
48
51
  }
@@ -1,10 +1,8 @@
1
1
 
2
2
  describe('foo', function(){
3
3
  it('should bar', function(){
4
-
5
- })
6
-
7
- it('should baz', function(){
8
- asdf
4
+ var obj = { name: 'tobi', age: 2, species: 'ferret', friends: [] };
5
+ var other = { name: 'tobi', age: 3, species: 'ferret', friends: ['loki', 'jane'] };
6
+ obj.should.eql(other);
9
7
  })
10
8
  })
@@ -1,4 +1,15 @@
1
1
 
2
+ 1.1.0 / 2012-07-30
3
+ ==================
4
+
5
+ * add enclosing of failure message functions. Closes #81
6
+ * add mocha .actual / .expected string support for all assertion values
7
+
8
+ 0.7.0 / 2012-07-17
9
+ ==================
10
+
11
+ * add `.throw(Constructor)` support [snakamura]
12
+
2
13
  0.6.3 / 2012-04-26
3
14
  ==================
4
15
 
@@ -1,5 +1,5 @@
1
1
  _should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org).
2
-
2
+
3
3
  It extends the Object prototype with a single non-enumerable getter that allows you to express how that object should behave.
4
4
 
5
5
  _should_ literally extends node's _assert_ module, in fact, it is node's assert module, for example `should.equal(str, 'foo')` will work, just as `assert.equal(str, 'foo')` would, and `should.AssertionError` **is** `assert.AssertionError`, meaning any test framework supporting this constructor will function properly with _should_.
@@ -13,7 +13,7 @@ _should_ literally extends node's _assert_ module, in fact, it is node's assert
13
13
 
14
14
  user.should.have.property('name', 'tj');
15
15
  user.should.have.property('pets').with.lengthOf(4);
16
-
16
+
17
17
  someAsyncTask(foo, function(err, result){
18
18
  should.not.exist(err);
19
19
  should.exist(result);
@@ -161,12 +161,12 @@ Assert __typeof__:
161
161
  user.should.be.a('object')
162
162
  'test'.should.be.a('string')
163
163
 
164
- ## instanceof
164
+ ## instanceof and instanceOf
165
165
 
166
- Assert __instanceof__:
166
+ Assert __instanceof__ or __instanceOf__:
167
167
 
168
168
  user.should.be.an.instanceof(User)
169
- [].should.be.an.instanceof(Array)
169
+ [].should.be.an.instanceOf(Array)
170
170
 
171
171
  ## above
172
172
 
@@ -229,13 +229,13 @@ Assert own property (on the immediate object):
229
229
  ## json
230
230
 
231
231
  Assert that Content-Type is "application/json; charset=utf-8"
232
-
232
+
233
233
  res.should.be.json
234
234
 
235
235
  ## html
236
236
 
237
237
  Assert that Content-Type is "text/html; charset=utf-8"
238
-
238
+
239
239
  res.should.be.html
240
240
 
241
241
  ## include(obj)
@@ -288,7 +288,7 @@ Assert an exception is not thrown:
288
288
 
289
289
  ```js
290
290
  (function(){
291
-
291
+
292
292
  }).should.not.throw();
293
293
  ```
294
294
  Assert exepection message matches string:
@@ -307,6 +307,18 @@ Assert exepection message matches regexp:
307
307
  }).should.throw(/^fail/);
308
308
  ```
309
309
 
310
+ ## throwError()
311
+
312
+ An alias of `throw`, its purpose is to be an option for those who run
313
+ [jshint](https://github.com/jshint/node-jshint/) in strict mode.
314
+
315
+ ```js
316
+ (function(){
317
+ throw new Error('failed to baz');
318
+ }).should.throwError(/^fail.*/);
319
+ ```
320
+
321
+
310
322
  ## keys
311
323
 
312
324
  Assert own object keys, which must match _exactly_,
@@ -334,7 +346,7 @@ For example you can use should with the [Expresso TDD Framework](http://github.c
334
346
 
335
347
  var lib = require('mylib')
336
348
  , should = require('should');
337
-
349
+
338
350
  module.exports = {
339
351
  'test .version': function(){
340
352
  lib.version.should.match(/^\d+\.\d+\.\d+$/);
@@ -351,7 +363,7 @@ To run the tests for _should_ simply update your git submodules and run:
351
363
 
352
364
  Yes, yes it does, with a single getter _should_, and no it won't break your code, because it does this **properly** with a non-enumerable property.
353
365
 
354
- ## License
366
+ ## License
355
367
 
356
368
  (The MIT License)
357
369