Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test result(object, fn) syntax.

  • Loading branch information...
commit 8c7b3455e7dc69ec39c6f06f662bea523ae0f1be 1 parent 84444e8
@ryanve authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 test/index.js
View
11 test/index.js
@@ -1,5 +1,8 @@
!function(aok) {
var plain = {}, instance = aok();
+ function called() {
+ return !arguments.length && this;
+ }
aok(function() {
return isFinite(this.id);
});
@@ -35,15 +38,17 @@
});
aok({
id: 'resultParams',
- test: aok.result(function() {
- return !arguments.length && aok === this;
- })
+ test: aok.result(called) === aok
});
aok({
id: 'resultReturn',
test: 1 === aok.result(1) && 1 === aok.result([1], 0)
});
aok({
+ id: 'resultDirect',
+ test: aok.result(instance, called) === instance
+ });
+ aok({
id: 'resultProto',
test: 1 === aok.prototype.result.call([1], 0)
});
Please sign in to comment.
Something went wrong with that request. Please try again.