var path = require("path")
  , expect = require("expect.js")
  , fs = require("fs")

script(path.join(__dirname, "..", "lib", "end-dash.js"), { module: true })
script(path.join(__dirname, "..", "lib", "collection.js"), { module: true })
script(path.join(__dirname, "..", "lib", "parser.js"), { module: true })
script(path.join(__dirname, "..", "lib", "util.js"), { module: true })

describe("An element with an attribute", function() {
  it("should set the attribute", function () {
    window.console = console
    var TemplateGenerator = window.require("/lib/end-dash")
      , Template = new TemplateGenerator(fs.readFileSync(__dirname + "/support/attributes.html").toString()).generate()
      , template = new Template

    template.set("name", "zach")

    $("body").append(template.template)
    expect($("#link").attr("href")).to.be("/person/zach")
  })
})

@@ -480,37 +480,8 @@
 ) %7B%0A
-    window.console = console%0A
     
@@ -536,16 +536,16 @@
 -dash%22)%0A
+
       , 
@@ -763,16 +763,16 @@
 mplate)%0A
-
     expe
@@ -829,8 +829,464 @@
   %7D)%0A%7D)%0A
+describe(%22An element with an attribute%22, function() %7B%0A  it(%22should set the attribute%22, function () %7B%0A    var TemplateGenerator = window.require(%22/lib/end-dash%22)%0A      , Template = new TemplateGenerator('%3Ca id = %22link%22 href = %22#%7Bone%7D and #%7Btwo%7D%22%3E%3C/a%3E').generate()%0A      , template = new Template%0A%0A    template.set(%22one%22, %221%22)%0A    template.set(%22two%22, %222%22)%0A%0A    $(%22body%22).append(template.template)%0A    expect($(%22#link%22).attr(%22href%22)).to.be(%221 and 2%22)%0A  %7D)%0A%7D)%0A

test for two vars in one attribute