File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ var proto = {
115115 isPresent : function isPresent ( ) {
116116 return ( typeof this . callArgAt === "number" ||
117117 this . exception ||
118+ this . exceptionCreator ||
118119 typeof this . returnArgAt === "number" ||
119120 this . returnThis ||
120121 this . resolveThis ||
Original file line number Diff line number Diff line change @@ -137,6 +137,19 @@ describe("stub", function () {
137137 stub ( ) ;
138138 } ) ;
139139 } ) ;
140+
141+ it ( "throws only on the first call" , function ( ) {
142+ var stub = createStub . create ( ) ;
143+ stub . returns ( "no exception" ) ;
144+ stub . onFirstCall ( ) . throws ( ) ;
145+
146+ assert . exception ( function ( ) {
147+ stub ( ) ;
148+ } ) ;
149+
150+ // on the second call there is no exception
151+ assert . same ( stub ( ) , "no exception" ) ;
152+ } ) ;
140153 } ) ;
141154
142155 describe ( ".resolves" , function ( ) {
You can’t perform that action at this time.
0 commit comments