Skip to content

Commit 04b3bac

Browse files
author
Cameron Cundiff
committed
Add auditor class and test.
1 parent 4161626 commit 04b3bac

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

access-lint-monitor.coffee

Lines changed: 0 additions & 5 deletions
This file was deleted.

auditor.coffee

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Auditor
2+
call: (dom) ->
3+
if dom
4+
@.log([ { error: "message" } ])
5+
6+
log: ->
7+
8+
module.exports = Auditor

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ var gulp = require("gulp");
44
var mocha = require("gulp-mocha");
55

66
gulp.task("default", function() {
7-
return gulp.src("test/test.coffee", { read: false })
7+
return gulp.src("test/*-test.coffee", { read: false })
88
.pipe(mocha());
99
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Auditor = require "../auditor"
2+
chai = require "chai"
3+
sinon = require "sinon"
4+
sinonChai = require "sinon-chai"
5+
expect = chai.expect
6+
7+
chai.use sinonChai
8+
9+
describe "#audit", ->
10+
context "with errors", ->
11+
it "phones home", ->
12+
dom = {}
13+
auditor = new Auditor()
14+
log = sinon.spy(auditor, "log")
15+
auditor.call(dom)
16+
17+
expect(log).to.have.been.calledWith([{ error: "message" }])

test/test.coffee

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)