Permalink
Browse files

Update tests to my new style

  • Loading branch information...
phawk committed Sep 28, 2013
1 parent 68a04b2 commit c52859895dd6f3a7850eea1a89cafdf5cdb58c50

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,5 +1,9 @@
# Recent changes
+## 0.3.2 28th Sept 2013
+
+* Bugfix: Grunt watcher for `test` directory
+
## 0.3.1 28th Sept 2013
* Update to new `bower` and update components
View
@@ -1,16 +1,13 @@
-# Backbone Stack (0.3.1)
+# Backbone Stack (0.3.2)
A pre-configured Backbone Stack for starting new projects, it alleviates a lot of the common boilerplate code and setup. It uses AMD modules, mocha for TDD and handlebars precompiled templates. Grunt plays a major role in the automated linting, testing and building of your code.
[![Build Status](https://travis-ci.org/phawk/Backbone-Stack.png?branch=master)](https://travis-ci.org/phawk/Backbone-Stack)
### Latest changes (28th Sept 2013)
+* Bugfix: Grunt watcher for `test` directory
* Update to new `bower` and update components
-* Update node version assets to 0.0.8 for some nice bugfixes
-* Update travis to use node 0.10
-* Update package.json to use grunt 0.4.1 for node 0.10.x
-* Upgrade Backbone to v 1.0.0.
[View the changelog](https://github.com/phawk/Backbone-Stack/blob/master/changelog.md)
@@ -2,38 +2,43 @@ define(
["chai", "helpers/sandbox"],
function(chai, Sandbox) {
- var expect = chai.expect;
+ var expect = chai.expect,
+ env;
suite("Sandbox", function() {
setup(function() {
- this.sandbox = Sandbox;
+ env = {};
+
+ env.sb = sinon.sandbox.create();
+
+ env.sandboxSpy = env.sb.spy();
+
+ env.sandbox = Sandbox;
});
teardown(function() {
- this.sandbox = null;
+ env.sb.restore();
});
test("Sandbox should exist", function() {
- expect(this.sandbox).to.be.ok;
+ expect(env.sandbox).to.be.ok;
});
test("should be capable of Pub Sub", function() {
// Arrange
- var sandboxSpy = sinon.spy();
- this.sandbox.on("some-event-name", sandboxSpy);
+ env.sandbox.on("some-event-name", env.sandboxSpy);
// Act
- this.sandbox.trigger("some-event-name");
+ env.sandbox.trigger("some-event-name");
// Assert
- expect(sandboxSpy.called).to.be.true;
+ expect(env.sandboxSpy.called).to.be.true;
// Cleanup
- this.sandbox.off("some-event-name", sandboxSpy);
- sandboxSpy = null;
+ env.sandbox.off("some-event-name", env.sandboxSpy);
});
});
-});
+});
@@ -2,31 +2,34 @@ define(
["jquery", "chai", "views/home/main"],
function($, chai, HomeMainView) {
- var expect = chai.expect;
+ var expect = chai.expect,
+ env;
suite("Home Main View", function() {
setup(function() {
- this.homemain = new HomeMainView({
+ env = {};
+
+ env.homemain = new HomeMainView({
el: $('<div>')
});
});
teardown(function() {
- this.homemain = null;
+ env.homemain.remove();
});
test("should exist", function() {
- expect(this.homemain).to.be.ok;
+ expect(env.homemain).to.be.an("object");
});
test("should render a welcome header", function() {
// Arrange
- this.homemain.render();
+ env.homemain.render();
- expect(this.homemain.$('h1').text()).to.equal("Welcome");
+ expect(env.homemain.$('h1').text()).to.equal("Welcome");
});
});
-});
+});

0 comments on commit c528598

Please sign in to comment.