|
On Wed, Aug 3, 2011 at 8:37 PM, Ryan Pusztai <rpusztai@gmail.com> wrote:One thing I did with Orbiter was to have a 'test' mode where the app
> I am wondering if anyone has any experience using Orbit [1] and developing
> tests for the created web application? I am looking for some
> general strategy and hoping that it can be done easily. Thanks.
would spit out the generated HTML, rather than serve it up.
The equivalent for Orbit would be to use wget to grab Orbit pages as
HTML and check that. Would certainly work as a regression test - i.e.
that a page continues to generate exactly the same code as before.
Orbit's htmlification mode is powerful but will output any tags,
spelled correctly or not. E.g. if you typed tabl {...} in a hurry you
would get <tabl ...> tags. So some kind of HTML verifier would be
useful.
Since such widgets could be useful for Orbit programmers as well, I've introduced some bridging code so that Orbit applications can also use Orbiter widgets. Look at the
dropdown-orbit.lua
example - the key statement is:module("dropdown_test", package.seeall, orbit.new, html.new)
That is,
html.new
is another function that gets passed the new module object. Please note that the actual widgets must be loaded after themodule
statement, since they may want to setup some static dispatches. This is somewhat clumsy, and likely to change in later versions: but the point is that the non-core parts of Orbiter can be used by Orbit.