aboutsummaryrefslogtreecommitdiffstats
path: root/src/scenario/Future.js
diff options
context:
space:
mode:
authorAndres Ornelas2010-06-30 09:51:54 -0700
committerAndres Ornelas2010-06-30 09:51:54 -0700
commit9d8646b0d1bee2ca60bbb7b494b63ab83e243072 (patch)
treefb78e3b93cce33aec11450235e9fd5f83e1a14ab /src/scenario/Future.js
parente664186f93838ca1fb1b2e4277f7c18264f81d92 (diff)
downloadangular.js-9d8646b0d1bee2ca60bbb7b494b63ab83e243072.tar.bz2
all tests passing with new futures concept
Diffstat (limited to 'src/scenario/Future.js')
-rw-r--r--src/scenario/Future.js45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/scenario/Future.js b/src/scenario/Future.js
index 057b89db..c718bba2 100644
--- a/src/scenario/Future.js
+++ b/src/scenario/Future.js
@@ -1,8 +1,8 @@
function Future(name, behavior) {
- this.value = undefined;
this.name = name;
this.behavior = behavior;
this.fulfilled = false;
+ this.value = undefined;
}
Future.prototype = {
@@ -11,25 +11,6 @@ Future.prototype = {
this.value = value;
}
};
-
-function future(name, behavior) {
- return new Future(name, behavior);
-};
-
-function repeater(selector) {
- var repeaterFuture = future('repeater ' + selector, function(done) {
- done($(selector));
- });
-
- repeaterFuture.count = function(){
- return future(repeaterFuture.name + ' count', function(done) {
- done(repeaterFuture.value.size());
- });
- };
-
- return repeaterFuture;
-}
-
function Matcher(future, logger) {
var self = this;
this.logger = logger;
@@ -52,6 +33,28 @@ Matcher.addMatcher = function(name, matcher){
Matcher.addMatcher('toEqual', function(a,b){ return a == b; });
-function expect(future) {
+/*
+
+function future(name, behavior) {
+ return new Future(name, behavior);
+};
+
+function repeater(selector) {
+ var repeaterFuture = future('repeater ' + selector, function(done) {
+ done($(selector));
+ });
+
+ repeaterFuture.count = function(){
+ return future(repeaterFuture.name + ' count', function(done) {
+ done(repeaterFuture.value.size());
+ });
+ };
+
+ return repeaterFuture;
+}
+
+function expectX(future) {
return new Matcher(future, window.alert);
}
+
+ */ \ No newline at end of file