Skip to content

Commit

Permalink
build v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Bailey committed Aug 18, 2012
1 parent 0a3bc92 commit b776091
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function(grunt) {
meta: {
version: '0.1.0',
banner: '// Jasmine.Async, v<%= meta.version %>\n' +
'// Copyright (c)<%= grunt.template.today("yyyy") %> Derick Bailey, Muted Solutions, LLC.\n' +
'// Copyright (c)<%= grunt.template.today("yyyy") %> Muted Solutions, LLC. All Rights Reserved.\n' +
'// Distributed under MIT license\n' +
'// http://github.com/derickbailey/jasmine.async'
},
Expand Down
51 changes: 51 additions & 0 deletions lib/jasmine.async.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Jasmine.Async, v0.1.0
// Copyright (c)2012 Muted Solutions, LLC. All Rights Reserved.
// Distributed under MIT license
// http://github.com/derickbailey/jasmine.async
this.AsyncSpec = (function(global){

// Private Methods
// ---------------

function runAsync(block){
return function(){
var done = false;
var complete = function(){ done = true; };

runs(function(){
block(complete);
});

waitsFor(function(){
return done;
});
};
}

// Constructor Function
// --------------------

function AsyncSpec(spec){
this.spec = spec;
}

// Public API
// ----------

AsyncSpec.prototype.beforeEach = function(block){
this.spec.beforeEach(runAsync(block));
};

AsyncSpec.prototype.afterEach = function(block){
this.spec.afterEach(runAsync(block));
};

AsyncSpec.prototype.it = function(description, block){
// For some reason, `it` is not attached to the current
// test suite, so it has to be called from the global
// context.
global.it(description, runAsync(block));
};

return AsyncSpec;
})(this);
5 changes: 5 additions & 0 deletions lib/jasmine.async.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Jasmine.Async, v0.1.0
// Copyright (c)2012 Muted Solutions, LLC. All Rights Reserved.
// Distributed under MIT license
// http://github.com/derickbailey/jasmine.async
this.AsyncSpec=function(a){function b(a){return function(){var b=!1,c=function(){b=!0};runs(function(){a(c)}),waitsFor(function(){return b})}}function c(a){this.spec=a}return c.prototype.beforeEach=function(a){this.spec.beforeEach(b(a))},c.prototype.afterEach=function(a){this.spec.afterEach(b(a))},c.prototype.it=function(c,d){a.it(c,b(d))},c}(this);

0 comments on commit b776091

Please sign in to comment.