From: Phlip Date: 2007-01-05T14:45:12+09:00 Subject: Re: how to lex javascript for an assert_js system? Ryan Platte wrote: > For Rails apps, by way of not testing the library('s JavaScript > output): stub out RJS's JavaScriptGenerator ('page' object)? Ultimately we are up against a "log string test". That's where you call an emulator or a real deal of some type, it emits a log of its behavior, and you parse into this log. You could, for example, take some server program, turn its log level up, call a high level function, read the log file as a string, and perform Regular Expressions on it to pull out target data. (/Error (.*)/ is a good start!;) Next, you might write a mock that records the calls sent to it as a sequence of data items, like the MockGraphics example I started this thread with. Here's the diagnostic when an assert_rjs fails: Content did not include: $("moose_panel").width = "50%";. <"$(\"wiki_panel\").width = \"50%\";\n$(\"mouse_panel\").width = \"50%\";\nElement.update(\"mouse_panel\", \"