Skip to content

Commit

Permalink
Adding 2 tests for Named Parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed Apr 5, 2015
1 parent 4be3fa8 commit d108672
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/indexSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,27 @@ describe("Method as.format", function () {
});
}).toThrow("Property 'prop2' doesn't exist.");

// test that case sensitivity works;
expect(function(){
pgp.as.format("${PropName}", {
propName: 'hello'
});
}).toThrow("Property 'PropName' doesn't exist.");

expect(function(){
pgp.as.format("${prop1},${prop2}", {
prop1: 'hello',
prop2: []
});
}).toThrow("Cannot convert type 'object' of property 'prop2'");

expect(function(){
pgp.as.format("${prop1},${prop2}", {
prop1: 'hello',
prop2: {}
});
}).toThrow("Cannot convert type 'object' of property 'prop2'");

expect(function(){
pgp.as.format("${prop1},${prop2}", {
prop1: 'hello',
Expand Down

0 comments on commit d108672

Please sign in to comment.