|
| 1 | +var should = require("should"); |
| 2 | +var sinon = require("sinon"); |
| 3 | +var NullDependency = require("../lib/dependencies/NullDependency"); |
| 4 | + |
| 5 | +describe("NullDependency", function() { |
| 6 | + var env; |
| 7 | + |
| 8 | + beforeEach(function() { |
| 9 | + env = {}; |
| 10 | + }); |
| 11 | + |
| 12 | + it("is a function", function() { |
| 13 | + NullDependency.should.be.a.Function(); |
| 14 | + }); |
| 15 | + |
| 16 | + describe("when created", function() { |
| 17 | + beforeEach(function() { |
| 18 | + env.nullDependency = new NullDependency(); |
| 19 | + }); |
| 20 | + |
| 21 | + it("has a null type", function() { |
| 22 | + env.nullDependency.type.should.be.exactly("null"); |
| 23 | + }); |
| 24 | + |
| 25 | + it("is not an equal resource", function() { |
| 26 | + env.nullDependency.isEqualResource().should.be.False(); |
| 27 | + }); |
| 28 | + |
| 29 | + it("has update hash function", function() { |
| 30 | + env.nullDependency.updateHash.should.be.Function(); |
| 31 | + }); |
| 32 | + |
| 33 | + it("does not update hash", function() { |
| 34 | + const hash = { |
| 35 | + update: sinon.stub() |
| 36 | + }; |
| 37 | + env.nullDependency.updateHash(hash); |
| 38 | + hash.update.called.should.be.false(); |
| 39 | + }); |
| 40 | + }); |
| 41 | + |
| 42 | + describe("Template", function() { |
| 43 | + it("is a function", function() { |
| 44 | + NullDependency.Template.should.be.a.Function(); |
| 45 | + }); |
| 46 | + |
| 47 | + describe("when created", function() { |
| 48 | + beforeEach(function() { |
| 49 | + env.nullDependencyTemplate = new NullDependency.Template(); |
| 50 | + }); |
| 51 | + |
| 52 | + it("has apply function", function() { |
| 53 | + env.nullDependencyTemplate.apply.should.be.Function(); |
| 54 | + }); |
| 55 | + }); |
| 56 | + }); |
| 57 | +}); |
0 commit comments