We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
I want to try this library for testing, but the immediate problem I've run into is that I can't re-use an instance. Essentially I want to do this:
pizza: &pizza ingredients: - ham - cheese - pineapple name: hawaiian mario: &mario name: Mario lunch: *pizza dinner: *pizza breakfast: *pizza
Except I want a single instance of Pizza. Eg so that mario.lunch == mario.dinner instead of just mario.lunch.equals(mario.dinner)
Pizza
mario.lunch == mario.dinner
mario.lunch.equals(mario.dinner)
Is there a built in way I can do this?
The text was updated successfully, but these errors were encountered:
At first, I thought I could do this with a custom ScriptHandler that lets me use a function like
ScriptHandler
pizza: &pizza ingredients: - ham - cheese - pineapple name: hawaiian mario: &mario name: Mario lunch: singleton(pizza) dinner: singleton(pizza) breakfast: singleton(pizza)
Where I planned to run:
@Override public Object run(ScriptFragment scriptFragment) { String ref = scriptFragment.getArguments().get(0); Object singleton = singletons.get(ref); if (singleton == null) { objectMother.bear(ref, SOME_UNKNOWN_CLASS) } }
But I don't have access to SOME_UNKNOWN_CLASS in this context, so I can't just cache it with a function
SOME_UNKNOWN_CLASS
Sorry, something went wrong.
No branches or pull requests
Hi!
I want to try this library for testing, but the immediate problem I've run into is that I can't re-use an instance. Essentially I want to do this:
Except I want a single instance of
Pizza
. Eg so thatmario.lunch == mario.dinner
instead of justmario.lunch.equals(mario.dinner)
Is there a built in way I can do this?
The text was updated successfully, but these errors were encountered: