Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
update all tests mustacher.hasOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sixertoy committed Aug 18, 2015
1 parent c150fc2 commit 7d49303
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/src/conditions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
sinon = require('sinon'),
expect = require('chai').expect,
handlebars = require('handlebars'),
mustacher = require(path.join(cwd, 'src/mustacher.js')),
Conditions = require(path.join(cwd, 'src/helpers/conditions.js'));

describe('conditions', function () {
Expand Down Expand Up @@ -71,6 +72,13 @@
expect(handlebars.createFrame.callCount).to.equal(1);
handlebars.createFrame.restore();
});
it('call mustacher hasOptions once', function(){
sinon.spy(mustacher, 'hasOptions');
helper.register();
helper.render(true, false, handlebarsOptions);
expect(mustacher.hasOptions.callCount).to.equal(1);
mustacher.hasOptions.restore();
});
});
describe('or', function () {
it('return true', function () {
Expand Down
8 changes: 8 additions & 0 deletions spec/src/equal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
sinon = require('sinon'),
expect = require('chai').expect,
handlebars = require('handlebars'),
mustacher = require(path.join(cwd, 'src/mustacher.js')),
Equal = require(path.join(cwd, 'src/helpers/equal.js'));

describe('equal', function () {
Expand Down Expand Up @@ -66,6 +67,13 @@
expect(handlebars.createFrame.callCount).to.equal(1);
handlebars.createFrame.restore();
});
it('call mustacher hasOptions once', function(){
sinon.spy(mustacher, 'hasOptions');
helper.register();
helper.render(true, false, handlebarsOptions);
expect(mustacher.hasOptions.callCount).to.equal(1);
mustacher.hasOptions.restore();
});
});

describe('isequal', function () {
Expand Down
8 changes: 8 additions & 0 deletions spec/src/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
sinon = require('sinon'),
expect = require('chai').expect,
handlebars = require('handlebars'),
mustacher = require(path.join(cwd, 'src/mustacher.js')),
Image = require(path.join(cwd, 'src/helpers/image.js'));
describe('image', function() {
beforeEach(function() {
Expand Down Expand Up @@ -38,6 +39,13 @@
helper.render({name: '$image'});
}).not.to.throw('missing arguments');
});
it('call mustacher hasOptions once', function(){
sinon.spy(mustacher, 'hasOptions');
helper.register();
helper.render({name: '$image'});
expect(mustacher.hasOptions.callCount).to.equal(1);
mustacher.hasOptions.restore();
});
});
describe('returns an image of 300x300', function() {
it('no width no height (300 default)', function() {
Expand Down

0 comments on commit 7d49303

Please sign in to comment.