On Mon, May 11, 2009 at 10:28 AM, [email protected] < [email protected]> wrote:
> > Hi, > > Scala supports true closures which means that variables in scope > (including > > "this") are bound to the function. > > > > Lift associates the function passed to SHtml.text(defaultValue, > > passedFunction) with a GUID and returns places that GUID in the name > > attribute of the generated <input/> HTML element. When the form is > > submitted, Lift looks up the GUID in the function table and calls the > > function with the passed parameter. > > > > So, the "by whom" answer is the "runParams" method in LiftSession. This > is > > done early in the request cycle. > > > > Does this help? > > > > Thanks, this clarified how it works. Do you have any recommendation > how these functions (those that are then called in runParams) would be > actually tested. My initial idea was to extract the functions from the > session (after calling snippet's function) and then call them in right > order to verify the result. This could be probably used but some how > sound a bit too complicated for a unit test. Give me a week or some and I think I'll have something that you'll like... basically, you can register a function that's called when stuff is added to the function table... and there'll be a "why" associated with the adding. When you're running in test mode, you can intercept the functions and then at some time in the future replay them and verify that they do the right thing(tm). > > > br, > - Erik > > > Thanks, > > > > David > > > > > I would like to understand this so that I could create tests for it. > > > > > br, > > > - Erik > > > > -- > > Lift, the simply functional web frameworkhttp://liftweb.net > > Beginning Scalahttp://www.apress.com/book/view/1430219890 > > Follow me:http://twitter.com/dpp > > Git some:http://github.com/dpp > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
