     @discardableResult
     public func stub() -> Stub {
         let stub = Stub()
+
+        // flush all the argument configurations from the storage
+        ArgumentStorageImpl.instance.flush()
 
         // mark instance as being ready for registration
         self.stubBeingRegistered = stub


    @discardableResult
    public func expect() -> Expectation {
        let stub = Stub()
        let expectation = self.expectationFactory.expectation(withStub: stub)


        // perform actual registration
        let ret: T? = self.register(function, with: argsConfig)


        return ret
    }
