Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more tests

  • Loading branch information...
commit 90e39019bb0e03129d0b582a2d930aec7ca9b0d0 1 parent 89eebc5
@tj authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/parser.js
View
23 test/parser.js
@@ -15,4 +15,27 @@ describe('Parser', function(){
parser.parse('{ "foo": "bar" }');
})
})
+
+ describe('.parse(str)', function(){
+ it('should invoke each plugin', function(done){
+ var parser = new Parser
+ , calls = [];
+
+ parser.use(function(key, val){
+ key.should.equal('foo');
+ val.should.equal('bar');
+ calls.push('a');
+ });
+
+ parser.use(function(key, val){
+ key.should.equal('foo');
+ val.should.equal('bar');
+ calls.push('b');
+ calls.should.eql(['a', 'b']);
+ done();
+ });
+
+ parser.parse('{ "foo": "bar" }');
+ })
+ })
})
Please sign in to comment.
Something went wrong with that request. Please try again.