"use strict";

var vows = require("vows"),
    assert = require("assert"),
    returns = require("../lib/returns");

vows.describe("Returns tests").addBatch({
    "get returns": {
        topic: function () {
            returns.getReturns(["YHOO", "IBM"], new Date(), this.callback);
        },

        "check returns": function (err, returns) {
            if (!err) {
            }
        }
    }

}).export(module);


@@ -168,16 +168,42 @@
  returns
+ with ref date in the past
 %22: %7B%0A   
@@ -279,20 +279,78 @@
 M%22%5D,
- new Date(),
+%0A                new Date(%22Sat Aug 06 2011 12:00:00%22),%0A               
  thi
@@ -396,16 +396,42 @@
  returns
+ with ref date in the past
 %22: funct
@@ -467,33 +467,808 @@
     
-if (!err) %7B%0A            %7D
+assert.ok(!err && returns.beforeRefDate.length === 2);%0A            assert.ok(!err && returns.beforeRefDate%5B0%5D.length %3E 0);%0A            assert.ok(!err && returns.beforeRefDate%5B1%5D.length %3E 0);%0A            assert.ok(!err && returns.afterRefDate%5B0%5D.length %3E 0);%0A            assert.ok(!err && returns.afterRefDate%5B1%5D.length %3E 0);%0A        %7D%0A    %7D,%0A%0A    %22get returns%22: %7B%0A        topic: function () %7B%0A            returns.getReturns(%5B%22YHOO%22, %22IBM%22%5D, new Date(), this.callback);%0A        %7D,%0A%0A        %22check returns%22: function (err, returns) %7B%0A            assert.ok(!err && returns.beforeRefDate.length === 2);%0A            assert.ok(!err && returns.beforeRefDate%5B0%5D.length %3E 0);%0A            assert.ok(!err && returns.beforeRefDate%5B1%5D.length %3E 0);%0A            assert.ok(!err && returns.afterRefDate.length === 0);
 %0A   

Implement returns test.