(function() {
  "use strict";

  describe("<%= pluginFullName %>", function() {

    var parent, slides, deck,

      createDeck = function() {
        var PARENT_TAG = 'article',
          SLIDE_TAG = 'section';

        slides = [];

        parent = document.createElement(PARENT_TAG);
        for (var i = 0; i < 10; i++) {
          slides.push(document.createElement(SLIDE_TAG));
          parent.appendChild(slides[i]);
        }

        document.body.appendChild(parent);

        deck = bespoke.from(PARENT_TAG, {
          myplugin: true
        });
      },

      destroyDeck = function() {
        document.body.removeChild(parent);
      };

    beforeEach(createDeck);
    afterEach(destroyDeck);

    describe("when a slide is activated", function() {

      beforeEach(function() {
        deck.slide(0);
      });

      it("should not a useless 'foobar' class to the slide", function() {
        expect(slides[0].classList.contains('foobar')).toBe(false);
      });

    });

  });

}());

@@ -85,16 +85,8 @@
  var
- parent,
  sli
@@ -133,78 +133,8 @@
 ) %7B%0A
-        var PARENT_TAG = 'article',%0A          SLIDE_TAG = 'section';%0A%0A
     
@@ -155,24 +155,28 @@
 %5D;%0A%0A        
+var 
 parent = doc
@@ -195,26 +195,25 @@
 Element(
-PARENT_TAG
+'article'
 );%0A     
@@ -295,17 +295,17 @@
 ent(
-SLIDE_TAG
+'section'
 ));%0A
@@ -360,52 +360,8 @@
  %7D%0A%0A
-        document.body.appendChild(parent);%0A%0A
     
@@ -388,18 +388,14 @@
 rom(
-PARENT_TAG
+parent
 , %7B%0A
@@ -442,146 +442,32 @@
    %7D
-,%0A%0A      destroyDeck = function() %7B%0A        document.body.removeChild(parent);%0A      %7D;%0A%0A    beforeEach(createDeck);%0A    afterEach(destroy
+;%0A%0A    beforeEach(create
 Deck

Simplify test setup