feature: unshift and shift for scope, working on #15

This commit is contained in:
harttle
2016-10-25 18:14:07 +08:00
parent 6135028015
commit da1d28e02e
2 changed files with 19 additions and 1 deletions
+12
View File
@@ -113,5 +113,17 @@ describe('scope', function() {
scope.pop();
expect(scope.get('foo')).to.equal('zoo');
});
it('should unshift scope', function() {
scope.unshift({foo: 'blue', foo1: 'foo1'})
scope.get('foo').should.equal('zoo');
scope.get('foo1').should.equal('foo1');
});
it('should shift scope', function() {
scope.unshift({foo: 'blue', foo1: 'foo1'});
scope.shift();
expect(scope.get('foo')).to.equal('zoo');
expect(scope.get('foo1')).to.equal(undefined);
});
});
});