Permalink
Browse files

Allow shorthand for passing test functions.

  • Loading branch information...
1 parent cd4d3c2 commit b968d67b6e4fed72fb7a2b55dfe4a65a1b3cfd35 @ryanve committed Apr 9, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 aok.js
View
8 aok.js
@@ -3,7 +3,7 @@
* @link github.com/ryanve/aok
* @license MIT
* @copyright 2013 Ryan Van Etten
- * @version 0.8.1
+ * @version 0.8.2
*/
/*jslint browser: true, devel: true, node: true, passfail: false, bitwise: true
@@ -25,12 +25,14 @@
/**
* @constructor
- * @param {Object=} data
+ * @param {Object|Function=} data
*/
function Aok(data) {
var k;
if (null != data) {
- for (k in data) {
+ if (typeof data == 'function') {
+ this['test'] = data;
+ } else for (k in data) {
this[k] = data[k];
}
this['run']();

0 comments on commit b968d67

Please sign in to comment.