     # ================
 
     test "Should throw an error when nothing is given", ->
-      try
-        dm.parseString();
-      catch err
-        error = err;
-
+
+      sinon.stub(async, "reject", (err) ->
+        return err;
+      );
+
+      error = dm.parseString();
+
+      sinon.assert.calledOnce(async.reject);
       assert.instanceOf error, Error;
 
     # ================


    setup ->
      dm = new DM;
      async  = sinon.stub(new Async);
      loader = sinon.stub(new Loader);

      console.log('lll', Async.prototype, Loader.prototype);


      dm.setAsync(async);
      dm.setLoader(loader.setAsync(async));

        .expects("getResource")
        .on(dm)
        .once()
        .withExactArgs(resource, handler, string)
        .returns(value);

      result = dm.parseString(string);
