Skip to content
Browse files

Update samples to not use buster-promise

  • Loading branch information...
1 parent c0b5c9c commit f47436af53df29ef964bded017334fc8d83d638a Christian Johansen committed Feb 8, 2012
Showing with 17 additions and 17 deletions.
  1. +8 −8 doc/samples/spec.js
  2. +9 −9 doc/samples/test-case.js
View
16 doc/samples/spec.js
@@ -1,6 +1,6 @@
if (typeof require != "undefined") {
var buster = require("../../lib/buster");
- buster.promise = require("buster-promise");
+ var when = require("when");
var assert = require("assert");
}
@@ -50,14 +50,14 @@ var spec2 = describe("Another test", function () {
});
shouldEventually("is asynchronous", function () {
- var promise = buster.promise.create(function () {
- setTimeout(function () {
- buster.log("Async");
- promise.resolve();
- }, 1000);
- });
+ var deferred = when.defer();
+
+ setTimeout(function () {
+ buster.log("Async");
+ deferred.resolver.resolve();
+ }, 1000);
- return promise;
+ return deferred.promise;
}),
should("puts the lotion on its skin or else it gets the hose again", function () {
View
18 doc/samples/test-case.js
@@ -1,6 +1,6 @@
if (typeof require != "undefined") {
var buster = require("../../lib/buster");
- buster.promise = require("buster-promise");
+ var when = require("when");
}
buster.testCase("Sample test", {
@@ -45,14 +45,14 @@ buster.testCase("Sample test", {
},
"look ma, I'm asynchronous": function () {
- var promise = buster.promise.create(function () {
- setTimeout(function () {
- buster.assert(true);
- promise.resolve();
- }, 200);
- });
-
- return promise;
+ var deferred = when.defer();
+
+ setTimeout(function () {
+ buster.assert(true);
+ deferred.resolver.resolve();
+ }, 200);
+
+ return deferred.promise;
},
"look ma, I'm implicitly asynchronous": function (done) {

0 comments on commit f47436a

Please sign in to comment.
Something went wrong with that request. Please try again.