Permalink
Browse files

Updated tests for double inject bug.

  • Loading branch information...
1 parent 0d013e4 commit db65e9c5f215738f48b1654d0b19c06730122d63 @easternbloc committed Feb 9, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/syringe.test.js
View
@@ -27,6 +27,13 @@ module.exports = testCase({
test.done();
},
+ 'trying to inject twice over a method will throw a already injected error': function(test) {
+ utilStub.inject('print', methodToInject);
+ test.throws(function(){ utilStub.inject('print', methodToInject); }, Error, 'Correctly thrown a already injected error');
+ utilStub.restore('print');
+ test.done();
+ },
+
'forceInject will forcefully inject if a method exists or not': function(test) {
var testMethodTrigger = false;
//Ensure the method doesn't exist to start with

0 comments on commit db65e9c

Please sign in to comment.