ende 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/component.json +2 -2
  3. data/components/component/bind/{0.0.1 → 1.0.0}/component.json +1 -1
  4. data/components/component/bind/{0.0.1 → 1.0.0}/index.js +1 -2
  5. data/components/component/jquery/1.0.0/component.json +10 -0
  6. data/components/component/jquery/1.0.0/index.js +10308 -0
  7. data/components/component/matches-selector/{0.1.2 → 0.1.4}/component.json +1 -1
  8. data/components/component/matches-selector/{0.1.2 → 0.1.4}/index.js +0 -0
  9. data/components/indefinido/advisable/master/component.json +1 -1
  10. data/components/indefinido/indemma/master/component.json +4 -7
  11. data/components/indefinido/indemma/master/lib/record.js +7 -2
  12. data/components/indefinido/indemma/master/lib/record/dirtyable.js +15 -6
  13. data/components/indefinido/indemma/master/lib/record/scopable.js +1 -1
  14. data/components/indefinido/observable/es6-modules/component.json +1 -1
  15. data/components/indefinido/observable/es6-modules/lib/legacy/schedulerable.js +8 -3
  16. data/components/indefinido/observable/es6-modules/lib/observable.js +0 -1
  17. data/components/indefinido/observable/es6-modules/lib/observable/observation.js +2 -2
  18. data/components/paulmillr/es6-shim/{0.10.1 → 0.14.0}/component.json +1 -1
  19. data/components/paulmillr/es6-shim/{0.10.1 → 0.14.0}/es6-shim.js +151 -102
  20. data/components/pluma/assimilate/{0.3.0 → 0.4.0}/component.json +2 -2
  21. data/components/pluma/assimilate/{0.3.0 → 0.4.0}/dist/assimilate.js +1 -1
  22. data/lib/assets/javascripts/aura/extensions/rivets.js.coffee +12 -6
  23. data/lib/assets/javascripts/config/load_components.js.coffee +1 -1
  24. data/lib/assets/javascripts/ende.js.coffee +1 -1
  25. data/lib/ende/version.rb +1 -1
  26. data/vendor/assets/component/build.css +112 -0
  27. data/vendor/assets/components/ende_build.js +20357 -19584
  28. metadata +13 -84
  29. data/components/chaijs/assertion-error/1.0.0/component.json +0 -18
  30. data/components/chaijs/assertion-error/1.0.0/index.js +0 -110
  31. data/components/chaijs/chai/1.9.1/.gitignore +0 -22
  32. data/components/chaijs/chai/1.9.1/.mailmap +0 -1
  33. data/components/chaijs/chai/1.9.1/.npmignore +0 -14
  34. data/components/chaijs/chai/1.9.1/.travis.yml +0 -14
  35. data/components/chaijs/chai/1.9.1/CONTRIBUTING.md +0 -173
  36. data/components/chaijs/chai/1.9.1/History.md +0 -895
  37. data/components/chaijs/chai/1.9.1/Makefile +0 -93
  38. data/components/chaijs/chai/1.9.1/README.md +0 -99
  39. data/components/chaijs/chai/1.9.1/ReleaseNotes.md +0 -482
  40. data/components/chaijs/chai/1.9.1/bower.json +0 -27
  41. data/components/chaijs/chai/1.9.1/chai.js +0 -4782
  42. data/components/chaijs/chai/1.9.1/component.json +0 -50
  43. data/components/chaijs/chai/1.9.1/index.js +0 -1
  44. data/components/chaijs/chai/1.9.1/karma.conf.js +0 -28
  45. data/components/chaijs/chai/1.9.1/karma.sauce.js +0 -41
  46. data/components/chaijs/chai/1.9.1/lib/chai.js +0 -87
  47. data/components/chaijs/chai/1.9.1/lib/chai/assertion.js +0 -130
  48. data/components/chaijs/chai/1.9.1/lib/chai/config.js +0 -50
  49. data/components/chaijs/chai/1.9.1/lib/chai/core/assertions.js +0 -1314
  50. data/components/chaijs/chai/1.9.1/lib/chai/interface/assert.js +0 -1056
  51. data/components/chaijs/chai/1.9.1/lib/chai/interface/expect.js +0 -12
  52. data/components/chaijs/chai/1.9.1/lib/chai/interface/should.js +0 -78
  53. data/components/chaijs/chai/1.9.1/lib/chai/utils/addChainableMethod.js +0 -111
  54. data/components/chaijs/chai/1.9.1/lib/chai/utils/addMethod.js +0 -43
  55. data/components/chaijs/chai/1.9.1/lib/chai/utils/addProperty.js +0 -40
  56. data/components/chaijs/chai/1.9.1/lib/chai/utils/flag.js +0 -32
  57. data/components/chaijs/chai/1.9.1/lib/chai/utils/getActual.js +0 -18
  58. data/components/chaijs/chai/1.9.1/lib/chai/utils/getEnumerableProperties.js +0 -25
  59. data/components/chaijs/chai/1.9.1/lib/chai/utils/getMessage.js +0 -49
  60. data/components/chaijs/chai/1.9.1/lib/chai/utils/getName.js +0 -20
  61. data/components/chaijs/chai/1.9.1/lib/chai/utils/getPathValue.js +0 -102
  62. data/components/chaijs/chai/1.9.1/lib/chai/utils/getProperties.js +0 -35
  63. data/components/chaijs/chai/1.9.1/lib/chai/utils/index.js +0 -114
  64. data/components/chaijs/chai/1.9.1/lib/chai/utils/inspect.js +0 -320
  65. data/components/chaijs/chai/1.9.1/lib/chai/utils/objDisplay.js +0 -49
  66. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteChainableMethod.js +0 -53
  67. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteMethod.js +0 -51
  68. data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteProperty.js +0 -54
  69. data/components/chaijs/chai/1.9.1/lib/chai/utils/test.js +0 -26
  70. data/components/chaijs/chai/1.9.1/lib/chai/utils/transferFlags.js +0 -44
  71. data/components/chaijs/chai/1.9.1/lib/chai/utils/type.js +0 -45
  72. data/components/chaijs/chai/1.9.1/package.json +0 -42
  73. data/components/chaijs/chai/1.9.1/sauce.browsers.js +0 -128
  74. data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_block.sh +0 -7
  75. data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_setup.sh +0 -53
  76. data/components/chaijs/chai/1.9.1/test/assert.js +0 -638
  77. data/components/chaijs/chai/1.9.1/test/auth/.gitkeep +0 -0
  78. data/components/chaijs/chai/1.9.1/test/bootstrap/index.js +0 -22
  79. data/components/chaijs/chai/1.9.1/test/bootstrap/karma.js +0 -22
  80. data/components/chaijs/chai/1.9.1/test/configuration.js +0 -133
  81. data/components/chaijs/chai/1.9.1/test/display/errors.js +0 -14
  82. data/components/chaijs/chai/1.9.1/test/display/message.js +0 -47
  83. data/components/chaijs/chai/1.9.1/test/expect.js +0 -814
  84. data/components/chaijs/chai/1.9.1/test/globalShould.js +0 -15
  85. data/components/chaijs/chai/1.9.1/test/plugins.js +0 -24
  86. data/components/chaijs/chai/1.9.1/test/should.js +0 -744
  87. data/components/chaijs/chai/1.9.1/test/utilities.js +0 -309
  88. data/components/chaijs/deep-eql/0.1.3/component.json +0 -20
  89. data/components/chaijs/deep-eql/0.1.3/lib/eql.js +0 -257
  90. data/components/chaijs/type-detect/0.1.1/component.json +0 -18
  91. data/components/chaijs/type-detect/0.1.1/lib/type.js +0 -142
  92. data/components/component/classes/1.2.1/component.json +0 -19
  93. data/components/component/classes/1.2.1/index.js +0 -184
  94. data/components/component/domify/1.2.2/component.json +0 -22
  95. data/components/component/domify/1.2.2/index.js +0 -87
  96. data/components/component/event/0.1.3/component.json +0 -13
  97. data/components/component/event/0.1.3/index.js +0 -35
  98. data/components/component/jquery/1.9.1/component.json +0 -14
  99. data/components/component/jquery/1.9.1/index.js +0 -9601
  100. data/components/component/query/0.0.3/component.json +0 -23
  101. data/components/component/query/0.0.3/index.js +0 -21
  102. data/lib/tasks/.gitkeep +0 -0
@@ -1,15 +0,0 @@
1
- describe('global should', function () {
2
- it('works', function () {
3
- var theGlobal = typeof window !== 'undefined'
4
- ? window
5
- : global;
6
-
7
- theGlobal.globalShould = chai.should();
8
-
9
- try {
10
- globalShould.not.exist(undefined);
11
- } finally {
12
- delete theGlobal.globalShould;
13
- }
14
- });
15
- });
@@ -1,24 +0,0 @@
1
- describe('plugins', function () {
2
-
3
- function plugin (chai) {
4
- if (chai.Assertion.prototype.testing) return;
5
-
6
- Object.defineProperty(chai.Assertion.prototype, 'testing', {
7
- get: function () {
8
- return 'successful';
9
- }
10
- });
11
- }
12
-
13
- it('basic usage', function () {
14
- chai.use(plugin);
15
- var expect = chai.expect;
16
- expect(expect('').testing).to.equal('successful');
17
- });
18
-
19
- it('double plugin', function () {
20
- chai.expect(function () {
21
- chai.use(plugin);
22
- }).to.not.throw();
23
- });
24
- });
@@ -1,744 +0,0 @@
1
- describe('should', function() {
2
- var should = chai.Should();
3
-
4
- it('assertion', function(){
5
- 'test'.should.be.a('string');
6
- should.equal('foo', 'foo');
7
- should.not.equal('foo', 'bar');
8
- });
9
-
10
- it('root exist', function () {
11
- var foo = 'foo'
12
- , bar = undefined;
13
- should.exist(foo);
14
- should.not.exist(bar);
15
-
16
- err(function () {
17
- should.exist(bar, 'blah');
18
- }, "blah: expected undefined to exist");
19
-
20
- err(function () {
21
- should.not.exist(foo, 'blah');
22
- }, "blah: expected 'foo' to not exist")
23
- });
24
-
25
- it('root equal', function () {
26
- var value1 = 'value'
27
- , value2 = 'value'
28
- , foo = 'foo';
29
- should.equal(value1, value2);
30
- should.not.equal(value1, foo);
31
-
32
- err(function () {
33
- should.equal(value1, foo, 'blah');
34
- }, "blah: expected 'value' to equal 'foo'");
35
-
36
- err(function () {
37
- should.not.equal(value1, value2, 'blah');
38
- }, "blah: expected 'value' to not equal 'value'")
39
- });
40
-
41
- it('root Throw', function () {
42
- should.Throw(function() { throw new Error('error!') }, Error, 'error!');
43
- should.not.Throw(function () { });
44
-
45
- err(function () {
46
- should.Throw(function () { throw new Error('error!') }, Error, 'needed user!', 'blah');
47
- }, "blah: expected [Function] to throw error including 'needed user!' but got 'error!'");
48
-
49
- err(function () {
50
- should.not.Throw(function () { throw new Error('error!') }, Error, 'error!', 'blah');
51
- }, "blah: expected [Function] to not throw 'Error' but 'Error: error!' was thrown");
52
- });
53
-
54
- it('true', function(){
55
- (true).should.be.true;
56
- false.should.not.be.true;
57
- (1).should.not.be.true;false
58
- false.should.have.been.false;
59
-
60
- err(function(){
61
- 'test'.should.be.true;
62
- }, "expected 'test' to be true")
63
- });
64
-
65
- it('ok', function(){
66
- true.should.be.ok;
67
- false.should.not.be.ok;
68
- (1).should.be.ok;
69
- (0).should.not.be.ok;
70
-
71
- err(function(){
72
- ''.should.be.ok;
73
- }, "expected '' to be truthy");
74
-
75
- err(function(){
76
- 'test'.should.not.be.ok;
77
- }, "expected 'test' to be falsy");
78
- });
79
-
80
- it('false', function(){
81
- false.should.be.false;
82
- true.should.not.be.false;
83
- (0).should.not.be.false;
84
-
85
- err(function(){
86
- ''.should.be.false;
87
- }, "expected '' to be false")
88
- });
89
-
90
- it('null', function(){
91
- (0).should.not.be.null;
92
-
93
- err(function(){
94
- ''.should.be.null;
95
- }, "expected '' to be null")
96
- });
97
-
98
- it('undefined', function(){
99
- (0).should.not.be.undefined;
100
-
101
- err(function(){
102
- ''.should.be.undefined;
103
- }, "expected '' to be undefined")
104
- });
105
-
106
- it('arguments', function(){
107
- var args = (function(){ return arguments; })(1,2,3);
108
- args.should.be.arguments;
109
- [].should.not.be.arguments;
110
- });
111
-
112
- it('.equal()', function(){
113
- var foo;
114
- should.equal(undefined, foo);
115
- });
116
-
117
- it('typeof', function(){
118
- 'test'.should.be.a('string');
119
-
120
- err(function(){
121
- 'test'.should.not.be.a('string');
122
- }, "expected 'test' not to be a string");
123
-
124
- (5).should.be.a('number');
125
- (new Number(1)).should.be.a('number');
126
- Number(1).should.be.a('number');
127
- (true).should.be.a('boolean');
128
- (new Array()).should.be.a('array');
129
- (new Object()).should.be.a('object');
130
- ({}).should.be.a('object');
131
- ([]).should.be.a('array');
132
- (function() {}).should.be.a('function');
133
-
134
- (5).should.be.a('number');
135
-
136
- err(function(){
137
- (5).should.not.be.a('number');
138
- }, "expected 5 not to be a number");
139
- });
140
-
141
- it('instanceof', function(){
142
- function Foo(){}
143
- new Foo().should.be.an.instanceof(Foo);
144
-
145
- err(function(){
146
- (3).should.an.instanceof(Foo, 'blah');
147
- }, "blah: expected 3 to be an instance of Foo");
148
- });
149
-
150
- it('within(start, finish)', function(){
151
- (5).should.be.within(5, 10);
152
- (5).should.be.within(3,6);
153
- (5).should.be.within(3,5);
154
- (5).should.not.be.within(1,3);
155
-
156
- err(function(){
157
- (5).should.not.be.within(4,6, 'blah');
158
- }, "blah: expected 5 to not be within 4..6");
159
-
160
- err(function(){
161
- (10).should.be.within(50,100, 'blah');
162
- }, "blah: expected 10 to be within 50..100");
163
-
164
- err(function(){
165
- ({ foo: 1 }).should.have.length.within(50,100, 'blah');
166
- }, "blah: expected { foo: 1 } to have a property 'length'");
167
- });
168
-
169
- it('above(n)', function(){
170
- (5).should.be.above(2);
171
- (5).should.be.greaterThan(2);
172
- (5).should.not.be.above(5);
173
- (5).should.not.be.above(6);
174
-
175
- err(function(){
176
- (5).should.be.above(6, 'blah');
177
- }, "blah: expected 5 to be above 6");
178
-
179
- err(function(){
180
- (10).should.not.be.above(6, 'blah');
181
- }, "blah: expected 10 to be at most 6");
182
-
183
- err(function(){
184
- ({foo: 1}).should.have.length.above(3, 'blah');
185
- }, "blah: expected { foo: 1 } to have a property 'length'");
186
- });
187
-
188
- it('least(n)', function(){
189
- (5).should.be.at.least(5);
190
- (5).should.not.be.at.least(6);
191
-
192
- err(function(){
193
- (5).should.be.at.least(6, 'blah');
194
- }, "blah: expected 5 to be at least 6");
195
-
196
- err(function(){
197
- (10).should.not.be.at.least(6, 'blah');
198
- }, "blah: expected 10 to be below 6");
199
-
200
- err(function(){
201
- ({foo: 1}).should.have.length.of.at.least(3, 'blah');
202
- }, "blah: expected { foo: 1 } to have a property 'length'");
203
- });
204
-
205
- it('below(n)', function(){
206
- (2).should.be.below(5);
207
- (2).should.be.lessThan(5);
208
- (2).should.not.be.below(2);
209
- (2).should.not.be.below(1);
210
-
211
- err(function(){
212
- (6).should.be.below(5, 'blah');
213
- }, "blah: expected 6 to be below 5");
214
-
215
- err(function(){
216
- (6).should.not.be.below(10, 'blah');
217
- }, "blah: expected 6 to be at least 10");
218
-
219
- err(function(){
220
- ({foo: 1}).should.have.length.below(3, 'blah');
221
- }, "blah: expected { foo: 1 } to have a property 'length'");
222
- });
223
-
224
- it('most(n)', function(){
225
- (2).should.be.at.most(2);
226
- (2).should.not.be.at.most(1);
227
-
228
- err(function(){
229
- (6).should.be.at.most(5, 'blah');
230
- }, "blah: expected 6 to be at most 5");
231
-
232
- err(function(){
233
- (6).should.not.be.at.most(10, 'blah');
234
- }, "blah: expected 6 to be above 10");
235
-
236
- err(function(){
237
- ({foo: 1}).should.have.length.of.at.most(3, 'blah');
238
- }, "blah: expected { foo: 1 } to have a property 'length'");
239
- });
240
-
241
- it('match(regexp)', function(){
242
- 'foobar'.should.match(/^foo/)
243
- 'foobar'.should.not.match(/^bar/)
244
-
245
- err(function(){
246
- 'foobar'.should.match(/^bar/i, 'blah')
247
- }, "blah: expected 'foobar' to match /^bar/i");
248
-
249
- err(function(){
250
- 'foobar'.should.not.match(/^foo/i, 'blah')
251
- }, "blah: expected 'foobar' not to match /^foo/i");
252
- });
253
-
254
- it('length(n)', function(){
255
- 'test'.should.have.length(4);
256
- 'test'.should.not.have.length(3);
257
- [1,2,3].should.have.length(3);
258
-
259
- err(function(){
260
- (4).should.have.length(3, 'blah');
261
- }, 'blah: expected 4 to have a property \'length\'');
262
-
263
- err(function(){
264
- 'asd'.should.not.have.length(3, 'blah');
265
- }, "blah: expected 'asd' to not have a length of 3");
266
- });
267
-
268
- it('eql(val)', function(){
269
- var a = new Date(1, 2, 3)
270
- , b = new Date(4, 5, 6);
271
-
272
- a.should.eql(a);
273
- a.should.not.eql(b);
274
- a.should.not.eql({});
275
- 'test'.should.eql('test');
276
- ({ foo: 'bar' }).should.eql({ foo: 'bar' });
277
- /a/.should.eql(/a/);
278
- /a/.should.not.eql(/b/);
279
- /a/.should.not.eql({});
280
- /a/g.should.eql(/a/g);
281
- /a/g.should.not.eql(/b/g);
282
- /a/i.should.eql(/a/i);
283
- /a/i.should.not.eql(/b/i);
284
- /a/m.should.eql(/a/m);
285
- /a/m.should.not.eql(/b/m);
286
- (1).should.eql(1);
287
- '4'.should.not.eql(4);
288
-
289
- err(function(){
290
- (4).should.eql(3, 'blah');
291
- }, 'blah: expected 4 to deeply equal 3');
292
- });
293
-
294
- it('equal(val)', function(){
295
- 'test'.should.equal('test');
296
- (1).should.equal(1);
297
-
298
- err(function(){
299
- (4).should.equal(3, 'blah');
300
- }, 'blah: expected 4 to equal 3');
301
-
302
- err(function(){
303
- '4'.should.equal(4, 'blah');
304
- }, "blah: expected '4' to equal 4");
305
- });
306
-
307
- it('empty', function(){
308
- function FakeArgs() {};
309
- FakeArgs.prototype.length = 0;
310
-
311
- ''.should.be.empty;
312
- 'foo'.should.not.be.empty;
313
- ([]).should.be.empty;
314
- (['foo']).should.not.be.empty;
315
- (new FakeArgs).should.be.empty;
316
- ({arguments: 0}).should.not.be.empty;
317
- ({}).should.be.empty;
318
- ({foo: 'bar'}).should.not.be.empty;
319
-
320
- err(function(){
321
- ''.should.not.be.empty;
322
- }, "expected \'\' not to be empty");
323
-
324
- err(function(){
325
- 'foo'.should.be.empty;
326
- }, "expected \'foo\' to be empty");
327
-
328
- err(function(){
329
- ([]).should.not.be.empty;
330
- }, "expected [] not to be empty");
331
-
332
- err(function(){
333
- (['foo']).should.be.empty;
334
- }, "expected [ \'foo\' ] to be empty");
335
-
336
- err(function(){
337
- (new FakeArgs).should.not.be.empty;
338
- }, "expected { length: 0 } not to be empty");
339
-
340
- err(function(){
341
- ({arguments: 0}).should.be.empty;
342
- }, "expected { arguments: 0 } to be empty");
343
-
344
- err(function(){
345
- ({}).should.not.be.empty;
346
- }, "expected {} not to be empty");
347
-
348
- err(function(){
349
- ({foo: 'bar'}).should.be.empty;
350
- }, "expected { foo: \'bar\' } to be empty");
351
- });
352
-
353
- it('property(name)', function(){
354
- 'test'.should.have.property('length');
355
- (4).should.not.have.property('length');
356
-
357
- err(function(){
358
- 'asd'.should.have.property('foo');
359
- }, "expected 'asd' to have a property 'foo'");
360
- });
361
-
362
- it('property(name, val)', function(){
363
- 'test'.should.have.property('length', 4);
364
- 'asd'.should.have.property('constructor', String);
365
-
366
- err(function(){
367
- 'asd'.should.have.property('length', 4, 'blah');
368
- }, "blah: expected 'asd' to have a property 'length' of 4, but got 3");
369
-
370
- err(function(){
371
- 'asd'.should.not.have.property('length', 3, 'blah');
372
- }, "blah: expected 'asd' to not have a property 'length' of 3");
373
-
374
- err(function(){
375
- 'asd'.should.not.have.property('foo', 3, 'blah');
376
- }, "blah: 'asd' has no property 'foo'");
377
-
378
- err(function(){
379
- 'asd'.should.have.property('constructor', Number, 'blah');
380
- }, "blah: expected 'asd' to have a property 'constructor' of [Function: Number], but got [Function: String]");
381
- });
382
-
383
- it('ownProperty(name)', function(){
384
- 'test'.should.have.ownProperty('length');
385
- 'test'.should.haveOwnProperty('length');
386
- ({ length: 12 }).should.have.ownProperty('length');
387
-
388
- err(function(){
389
- ({ length: 12 }).should.not.have.ownProperty('length', 'blah');
390
- }, "blah: expected { length: 12 } to not have own property 'length'");
391
- });
392
-
393
- it('string()', function(){
394
- 'foobar'.should.contain.string('bar');
395
- 'foobar'.should.contain.string('foo');
396
- 'foobar'.should.not.contain.string('baz');
397
-
398
- err(function(){
399
- (3).should.contain.string('baz', 'blah');
400
- }, "blah: expected 3 to be a string");
401
-
402
- err(function(){
403
- 'foobar'.should.contain.string('baz', 'blah');
404
- }, "blah: expected 'foobar' to contain 'baz'");
405
-
406
- err(function(){
407
- 'foobar'.should.not.contain.string('bar', 'blah');
408
- }, "blah: expected 'foobar' to not contain 'bar'");
409
- });
410
-
411
- it('include()', function(){
412
- ['foo', 'bar'].should.include('foo');
413
- ['foo', 'bar'].should.contain('foo');
414
- ['foo', 'bar'].should.include('bar');
415
- [1,2].should.include(1);
416
- ['foo', 'bar'].should.not.include('baz');
417
- ['foo', 'bar'].should.not.include(1);
418
- ({a:1,b:2}).should.include({b:2});
419
- ({a:1,b:2}).should.not.include({b:3});
420
-
421
- err(function(){
422
- ['foo'].should.include('bar', 'blah');
423
- }, "blah: expected [ 'foo' ] to include 'bar'");
424
-
425
- err(function(){
426
- ['bar', 'foo'].should.not.include('foo', 'blah');
427
- }, "blah: expected [ 'bar', 'foo' ] to not include 'foo'");
428
-
429
- err(function(){
430
- ({a:1}).should.include({b:2});
431
- }, "expected { a: 1 } to have a property 'b'")
432
- });
433
-
434
- it('keys(array)', function(){
435
- ({ foo: 1 }).should.have.keys(['foo']);
436
- ({ foo: 1, bar: 2 }).should.have.keys(['foo', 'bar']);
437
- ({ foo: 1, bar: 2 }).should.have.keys('foo', 'bar');
438
- ({ foo: 1, bar: 2, baz: 3 }).should.include.keys('foo', 'bar');
439
- ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('bar', 'foo');
440
- ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('baz');
441
-
442
- ({ foo: 1, bar: 2 }).should.contain.keys('foo');
443
- ({ foo: 1, bar: 2 }).should.contain.keys('bar', 'foo');
444
- ({ foo: 1, bar: 2 }).should.contain.keys(['foo']);
445
- ({ foo: 1, bar: 2 }).should.contain.keys(['bar']);
446
- ({ foo: 1, bar: 2 }).should.contain.keys(['bar', 'foo']);
447
-
448
- ({ foo: 1, bar: 2 }).should.not.have.keys('baz');
449
- ({ foo: 1, bar: 2 }).should.not.have.keys('foo', 'baz');
450
- ({ foo: 1, bar: 2 }).should.not.contain.keys('baz');
451
- ({ foo: 1, bar: 2 }).should.not.contain.keys('foo', 'baz');
452
- ({ foo: 1, bar: 2 }).should.not.contain.keys('baz', 'foo');
453
-
454
- err(function(){
455
- ({ foo: 1 }).should.have.keys();
456
- }, "keys required");
457
-
458
- err(function(){
459
- ({ foo: 1 }).should.have.keys([]);
460
- }, "keys required");
461
-
462
- err(function(){
463
- ({ foo: 1 }).should.not.have.keys([]);
464
- }, "keys required");
465
-
466
- err(function(){
467
- ({ foo: 1 }).should.contain.keys([]);
468
- }, "keys required");
469
-
470
- err(function(){
471
- ({ foo: 1 }).should.have.keys(['bar']);
472
- }, "expected { foo: 1 } to have key 'bar'");
473
-
474
- err(function(){
475
- ({ foo: 1 }).should.have.keys(['bar', 'baz']);
476
- }, "expected { foo: 1 } to have keys 'bar', and 'baz'");
477
-
478
- err(function(){
479
- ({ foo: 1 }).should.have.keys(['foo', 'bar', 'baz']);
480
- }, "expected { foo: 1 } to have keys 'foo', 'bar', and 'baz'");
481
-
482
- err(function(){
483
- ({ foo: 1 }).should.not.have.keys(['foo']);
484
- }, "expected { foo: 1 } to not have key 'foo'");
485
-
486
- err(function(){
487
- ({ foo: 1 }).should.not.have.keys(['foo']);
488
- }, "expected { foo: 1 } to not have key 'foo'");
489
-
490
- err(function(){
491
- ({ foo: 1, bar: 2 }).should.not.have.keys(['foo', 'bar']);
492
- }, "expected { foo: 1, bar: 2 } to not have keys 'foo', and 'bar'");
493
-
494
- err(function(){
495
- ({ foo: 1 }).should.not.contain.keys(['foo']);
496
- }, "expected { foo: 1 } to not contain key 'foo'");
497
-
498
- err(function(){
499
- ({ foo: 1 }).should.contain.keys('foo', 'bar');
500
- }, "expected { foo: 1 } to contain keys 'foo', and 'bar'");
501
- });
502
-
503
- it('throw', function () {
504
- // See GH-45: some poorly-constructed custom errors don't have useful names
505
- // on either their constructor or their constructor prototype, but instead
506
- // only set the name inside the constructor itself.
507
- var PoorlyConstructedError = function () {
508
- this.name = 'PoorlyConstructedError';
509
- };
510
- PoorlyConstructedError.prototype = Object.create(Error.prototype);
511
-
512
- function CustomError(message) {
513
- this.name = 'CustomError';
514
- this.message = message;
515
- }
516
- CustomError.prototype = Error.prototype;
517
-
518
- var specificError = new RangeError('boo');
519
-
520
- var goodFn = function () { 1==1; }
521
- , badFn = function () { throw new Error('testing'); }
522
- , stringErrFn = function () { throw 'testing'; }
523
- , refErrFn = function () { throw new ReferenceError('hello'); }
524
- , ickyErrFn = function () { throw new PoorlyConstructedError(); }
525
- , specificErrFn = function () { throw specificError; }
526
- , customErrFn = function() { throw new CustomError('foo'); };
527
-
528
- (goodFn).should.not.throw();
529
- (goodFn).should.not.throw(Error);
530
- (goodFn).should.not.throw(specificError);
531
- (badFn).should.throw();
532
- (badFn).should.throw(Error);
533
- (badFn).should.not.throw(ReferenceError);
534
- (badFn).should.not.throw(specificError);
535
- (stringErrFn).should.throw();
536
- (stringErrFn).should.not.throw(ReferenceError);
537
- (stringErrFn).should.not.throw(specificError);
538
- (refErrFn).should.throw();
539
- (refErrFn).should.throw(ReferenceError);
540
- (refErrFn).should.throw(Error);
541
- (refErrFn).should.not.throw(TypeError);
542
- (refErrFn).should.not.throw(specificError);
543
- (ickyErrFn).should.throw();
544
- (ickyErrFn).should.throw(PoorlyConstructedError);
545
- (ickyErrFn).should.throw(Error);
546
- (ickyErrFn).should.not.throw(specificError);
547
- (specificErrFn).should.throw(specificError);
548
-
549
- (badFn).should.throw(/testing/);
550
- (badFn).should.throw('testing');
551
- (badFn).should.not.throw(/hello/);
552
- (badFn).should.not.throw('hello');
553
- (badFn).should.throw(Error, /testing/);
554
- (badFn).should.throw(Error, 'testing');
555
-
556
- (stringErrFn).should.throw(/testing/);
557
- (stringErrFn).should.throw('testing');
558
- (stringErrFn).should.not.throw(/hello/);
559
- (stringErrFn).should.not.throw('hello');
560
-
561
- should.throw(badFn);
562
- should.throw(refErrFn, ReferenceError);
563
- should.throw(refErrFn, Error);
564
- should.throw(ickyErrFn, PoorlyConstructedError);
565
- should.throw(specificErrFn, specificError);
566
- should.not.throw(goodFn);
567
- should.not.throw(badFn, ReferenceError);
568
- should.not.throw(badFn, specificError);
569
-
570
- should.throw(badFn, Error, /testing/);
571
- should.throw(badFn, Error, 'testing');
572
-
573
- err(function(){
574
- (goodFn).should.throw();
575
- }, "expected [Function] to throw an error");
576
-
577
- err(function(){
578
- (goodFn).should.throw(ReferenceError);
579
- }, "expected [Function] to throw ReferenceError");
580
-
581
- err(function(){
582
- (goodFn).should.throw(specificError);
583
- }, "expected [Function] to throw 'RangeError: boo'");
584
-
585
- err(function(){
586
- (badFn).should.not.throw();
587
- }, "expected [Function] to not throw an error but 'Error: testing' was thrown");
588
-
589
- err(function(){
590
- (badFn).should.throw(ReferenceError);
591
- }, "expected [Function] to throw 'ReferenceError' but 'Error: testing' was thrown");
592
-
593
- err(function(){
594
- (badFn).should.throw(specificError);
595
- }, "expected [Function] to throw 'RangeError: boo' but 'Error: testing' was thrown");
596
-
597
- err(function(){
598
- (badFn).should.not.throw(Error);
599
- }, "expected [Function] to not throw 'Error' but 'Error: testing' was thrown");
600
-
601
- err(function(){
602
- (stringErrFn).should.not.throw();
603
- }, "expected [Function] to not throw an error but 'testing' was thrown");
604
-
605
- err(function(){
606
- (stringErrFn).should.throw(ReferenceError);
607
- }, "expected [Function] to throw 'ReferenceError' but 'testing' was thrown");
608
-
609
- err(function(){
610
- (stringErrFn).should.throw(specificError);
611
- }, "expected [Function] to throw 'RangeError: boo' but 'testing' was thrown");
612
-
613
- err(function(){
614
- (stringErrFn).should.not.throw('testing');
615
- }, "expected [Function] to throw error not including 'testing'");
616
-
617
- err(function(){
618
- (refErrFn).should.not.throw(ReferenceError);
619
- }, "expected [Function] to not throw 'ReferenceError' but 'ReferenceError: hello' was thrown");
620
-
621
- err(function(){
622
- (badFn).should.throw(PoorlyConstructedError);
623
- }, "expected [Function] to throw 'PoorlyConstructedError' but 'Error: testing' was thrown")
624
-
625
- err(function(){
626
- (ickyErrFn).should.not.throw(PoorlyConstructedError);
627
- }, /^(expected \[Function\] to not throw 'PoorlyConstructedError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/);
628
-
629
- err(function(){
630
- (ickyErrFn).should.throw(ReferenceError);
631
- }, /^(expected \[Function\] to throw 'ReferenceError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/);
632
-
633
- err(function(){
634
- (specificErrFn).should.throw(new ReferenceError('eek'));
635
- }, "expected [Function] to throw 'ReferenceError: eek' but 'RangeError: boo' was thrown");
636
-
637
- err(function(){
638
- (specificErrFn).should.not.throw(specificError);
639
- }, "expected [Function] to not throw 'RangeError: boo'");
640
-
641
- err(function (){
642
- (badFn).should.not.throw(/testing/);
643
- }, "expected [Function] to throw error not matching /testing/");
644
-
645
- err(function () {
646
- (badFn).should.throw(/hello/);
647
- }, "expected [Function] to throw error matching /hello/ but got \'testing\'");
648
-
649
- err(function () {
650
- (badFn).should.throw(Error, /hello/, 'blah');
651
- }, "blah: expected [Function] to throw error matching /hello/ but got 'testing'");
652
-
653
- err(function () {
654
- (badFn).should.throw(Error, 'hello', 'blah');
655
- }, "blah: expected [Function] to throw error including 'hello' but got 'testing'");
656
-
657
- err(function () {
658
- (customErrFn).should.not.throw();
659
- }, "expected [Function] to not throw an error but 'CustomError: foo' was thrown");
660
- });
661
-
662
- it('respondTo', function(){
663
- function Foo(){};
664
- Foo.prototype.bar = function(){};
665
- Foo.func = function(){};
666
-
667
- var bar = {};
668
- bar.foo = function(){};
669
-
670
- Foo.should.respondTo('bar');
671
- Foo.should.not.respondTo('foo');
672
- Foo.should.itself.respondTo('func');
673
- Foo.should.itself.not.respondTo('bar');
674
-
675
- bar.should.respondTo('foo');
676
-
677
- err(function(){
678
- Foo.should.respondTo('baz', 'constructor');
679
- }, /^(constructor: expected)(.*)(\[Function: Foo\])(.*)(to respond to \'baz\')$/);
680
-
681
- err(function(){
682
- bar.should.respondTo('baz', 'object');
683
- }, /^(object: expected)(.*)(\{ foo: \[Function\] \}|\{ Object \()(.*)(to respond to \'baz\')$/);
684
- });
685
-
686
- it('satisfy', function(){
687
- var matcher = function (num){
688
- return num === 1;
689
- };
690
-
691
- (1).should.satisfy(matcher);
692
-
693
- err(function(){
694
- (2).should.satisfy(matcher, 'blah');
695
- }, "blah: expected 2 to satisfy [Function]");
696
- });
697
-
698
- it('closeTo', function(){
699
- (1.5).should.be.closeTo(1.0, 0.5);
700
-
701
- err(function(){
702
- (2).should.be.closeTo(1.0, 0.5, 'blah');
703
- }, "blah: expected 2 to be close to 1 +/- 0.5");
704
- });
705
-
706
- it('include.members', function() {
707
- [1, 2, 3].should.include.members([3]);
708
- [1, 2, 3].should.include.members([]);
709
- [1, 2, 3].should.include.members([2, 1]);
710
-
711
- [1, 2, 3].should.not.include.members([999]);
712
- [].should.not.include.members([23]);
713
-
714
- err(function() {
715
- [].should.include.members([43]);
716
- }, 'expected [] to be a superset of [ 43 ]');
717
-
718
- err(function() {
719
- [5, 2, 1].should.not.include.members([2]);
720
- }, 'expected [ 5, 2, 1 ] to not be a superset of [ 2 ]');
721
-
722
- err(function() {
723
- 'foo'.should.include.members([12]);
724
- }, "expected 'foo' to be an array");
725
-
726
- err(function() {
727
- [1, 2, 3].should.include.members('o');
728
- }, "expected 'o' to be an array");
729
- });
730
-
731
- it('memberEquals', function() {
732
- [1, 2, 3].should.have.same.members([3, 2, 1]);
733
- [5, 4].should.have.same.members([5, 4]);
734
- [].should.have.same.members([]);
735
-
736
- err(function() {
737
- [1, 2, 3].should.have.same.members([]);
738
- }, 'expected [ 1, 2, 3 ] to have the same members as []');
739
-
740
- err(function() {
741
- [1, 2, 3].should.have.same.members(4);
742
- }, 'expected 4 to be an array');
743
- });
744
- });