The issue is that I have a set of integration tests to test a Lift app and whilst they are logically different parts, I need to boot the lift environment first, so I was using the beforeSpec and afterSpec functions to setup the environment. However, depending upon the order the specs run, i occasionally get blow outs where the lift environment is already loaded.
What's the best way to handle this?
Cheers, Tim
> --
> You received this message because you are subscribed to the Google Groups "specs-users" group.
> To post to this group, send email to specs...@googlegroups.com.
> To unsubscribe from this group, send email to specs-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/specs-users?hl=en.
>
The only Lift api that exists is LiftRules.doneBoot; however, thats package private right now. I had played around with a hack that pretended to also be in lifts http package to access the variable, but that didn't really work. Your idea of checking one of the LiftRules is not a bad idea; again, its a little hacky though.
Yeah the ugly way is what I have right now, and man is it ugly ;-)
Cheers, Tim
Cheers, Tim
Cheers, Tim
What are your thoughts on stuffing my tests into wrapper traits and then composing them into one large runanble specification that does the setup and tear down? This is completely sub-optiomal, but really, I cant see a route out. If you have separate specifications (for example, I have some that need booted to use WebSpec and others that are selenium testing - distinctly different) even if they all use a full blown jetty which starts up and shuts down around each spec, the configuration of boot is still in the class loader, so it explodes on loading with the following spec. In addition, you never knew which will be the last spec, so you cant be sure where you need to call the cleanup operations.
Cheers, Tim
On 6 Mar 2011, at 00:30, etorreborre wrote:
Cheers, Tim
> you'll always end up with issues with unchangeable state in LiftRules provided they are all within the same classloader.
I'd like to better understand this behavior. The "booted" variable
should prevent that we call the Boot class again. Is it because you
have some tests which start a jetty-instance and that instance boots
up Lift?
> What are your thoughts on stuffing my tests into wrapper traits and then composing them into one large runanble specification that does the setup and tear down?
If you want to go this route you'd better use specs2 :-). It is really
designed so that you can build examples and expectations from
different places and then associate them in the same specification.
I'm not too sure this would work ok with specs.
The last possibility is to define different test suites: unit test
suites where you control the Boot with BootTest and integration test-
suite where you boot "externally" once by starting your system under
test then run you run your tests. I've rarely seen both tests run in
the same suite.
E.