Open twashing opened 10 years ago
Perhaps the system can be placed in a Jig namespace that is accessible. There are examples of components that do hold on to the system (the console for example). Perhaps you can add a 'test' component that can bind the system given to its init function into an atom that you can access.
I'm not sure I fully understand what you're trying to do, so if you have time to expand the description it would help me. But I like the approach you are taking to testing a system's construction.
Yes, absolutely.
The basic idea is to have Jig's invocation lifecycle driven from tests. Currently, I think it's all done from the console. And the console's (go) and (reset) functions pass in the system to a Component's (init) (start), etc functions. What I'd like, is for my test's (go) and (reset) functions to pass in the system data. I'm already doing that myself. But it currently lives outside of Jig's workflow. So I don't know how to bring in other components like Compojure, etc. Does this make sense?
And upon reflection, there are 2 other things in addition to this, that I think make sense.
These are a lot of enhancements, I realise. But they are just use cases that I find compelling, and am currently investigating.
Tim Washington Interruptsoftware.com http://interruptsoftware.com 347.673.3719
On Thu, Dec 12, 2013 at 6:01 AM, Malcolm Sparks notifications@github.comwrote:
Perhaps the system can be placed in a Jig namespace that is accessible. There are examples of components that do hold on to the system (the console for example). Perhaps you can add a 'test' component that can bind the system given to its init function into an atom that you can access.
I'm not sure I fully understand what you're trying to do, so if you have time to expand the description it would help me. But I like the approach you are taking to testing a system's construction.
— Reply to this email directly or view it on GitHubhttps://github.com/juxt/jig/issues/8#issuecomment-30406792 .
This is a feature request. It would be nice to drive the Lifecycle of my component / system, from my test code. Seems that jig assumes we will always drive development from the repl (thus refresh, reset, etc).
But most times, I want my tests (or some main fn), to thread the system state through my Component Lifecycle. For example, in the below code,
kernel/start-system
andkernel/get-system
don't have access to jig's system state (jig'suser
namespace isn't accessible to external projects, not driven from test).https://www.refheap.com/21606