describe("Computed", function() {
  var computed = createTestElement("computed", "<p>{{msg}}</p><p>{{reversed}}</p>");
  var called = false;

  var app = new Moon({
    root: "#computed",
    data: {
      msg: "Message",
      foo: false
    },
    computed: {
      reversed: {
        get: function() {
          called = true;
          return this.get("msg").split("").reverse().join("");
        }
      }
    }
  });

  it("should compute at initial render", function() {
    return wait(function() {
      expect(computed.childNodes[1].textContent).to.equal("egasseM");
    });
  });

  it("should update when the message updates", function() {
    app.set("msg", "New");
    return wait(function() {
      expect(computed.childNodes[1].textContent).to.equal("weN");
    });
  });

  it("should cache the value if a non-dependency is changed", function() {
    called = false;
    app.set("foo", true);

    return wait(function() {
      expect(called).to.be["false"];
      expect(computed.childNodes[1].textContent).to.equal("weN");
    });
  });
});

@@ -108,20 +108,40 @@
 ed%7D%7D%3C/p%3E
+%3Cp%3E%7B%7Btruncated%7D%7D%3C/p%3E
 %22);%0A
-
   var ca
@@ -413,24 +413,171 @@
 ;%0A        %7D%0A
+      %7D,%0A      truncated: %7B%0A        get: function() %7B%0A          called = true;%0A          return this.get(%22msg%22).substring(0, 3) + %22...%22;%0A        %7D%0A
       %7D%0A    
@@ -734,24 +734,93 @@
 %22egasseM%22);%0A
+      expect(computed.childNodes%5B2%5D.textContent).to.equal(%22Mes...%22);%0A
     %7D);%0A  %7D)
@@ -996,32 +996,101 @@
 o.equal(%22weN%22);%0A
+      expect(computed.childNodes%5B2%5D.textContent).to.equal(%22New...%22);%0A
     %7D);%0A  %7D);%0A%0A 
@@ -1276,16 +1276,16 @@
 alse%22%5D;%0A
-
       ex
@@ -1338,24 +1338,93 @@
 ual(%22weN%22);%0A
+      expect(computed.childNodes%5B2%5D.textContent).to.equal(%22New...%22);%0A
     %7D);%0A  %7D)

add tests for having multiple dependencies