Skip to content

Commit

Permalink
Re #83 Proved import error when importing objects or paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bemson committed Feb 13, 2014
1 parent 057ea16 commit 144275e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/api.tag.import.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,48 @@ describe( '_import tag', function () {
salt.query('//b/c/d/').should.be.ok;
});

it( 'should merge phase callbacks (based on path)', function () {
var
inSpy = sinon.spy(),
onSpy = sinon.spy(),
outSpy = sinon.spy(),
salt = new Salt({
_import: '//templateBranch/',
_on: onSpy,
templateBranch: {
_in: inSpy,
_out: outSpy
}
});
salt.go(1, 0);
inSpy.should.have.been.calledOnce;
onSpy.should.have.been.calledOnce;
outSpy.should.have.been.calledOnce;
inSpy.should.have.been.calledBefore(onSpy);
onSpy.should.have.been.calledBefore(outSpy);
});

it( 'should merge phase callbacks (based on object)', function () {
var
inSpy = sinon.spy(),
onSpy = sinon.spy(),
outSpy = sinon.spy(),
phasesObj = {
_in: inSpy,
_out: outSpy
},
salt = new Salt({
_import: phasesObj,
_on: onSpy
});
salt.go(1, 0);
inSpy.should.have.been.calledOnce;
onSpy.should.have.been.calledOnce;
outSpy.should.have.been.calledOnce;
inSpy.should.have.been.calledBefore(onSpy);
onSpy.should.have.been.calledBefore(outSpy);
});

it( 'should deep clone a Salt instance', function () {
var cSalt = new Salt({
c: {
Expand Down

0 comments on commit 144275e

Please sign in to comment.