-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
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
@NestedSteps should allow formatting of nested steps #334
Comments
The question is why you want to use nested steps here. JGiven can format complex objects and you can provide your own formatter for that. See http://jgiven.org/userguide/#_the_pojoformat_annotation for more details. Please check whether this solves your use case. Regarding your 2nd question: no there is no mechanism yet to have custom step listeners. There is already an open issue for that: #328 |
Yes, I know about the POJO formatter but that is not enough for my usecase. Example: cust2 = new Customer{ A custom stepListener also would solve problem such as this, because I would then be able to take control of how my steps are formatted. I think the distinguishing feature of JGiven when compared to Spock etc... is the ability to automatically generate Scenario text and there should be all flexibility in that process. I feel this is important feature for JGiven. |
Ok, I think I got it now. It is similar to #83. I think. The only difference is that you want to also be able to specify how the steps are formatted. |
Yes. correct. I saw #83 . I understood that to get builders which again take embedded builders, I needed lambdas. So, I figured out I could use groovy closures to get nested steps but then the nested step is always differentiated only by its indentation. I want to be able to control the formatting of the steps |
Currently the nested steps are just indented. What if I want to enclose nested steps in curly braces?
something like - If I use groovy to write JGiven tests, I can easily create a dsl to create a customer instance:
I want the above DSL to appear as it is even in the console report.
The methods name, Age, Gender are nested steps inside Customer. I tag the Customer method with @NestedSteps but it would have been nice if it allows us to format the nested steps, may be using a PrintFormatter etc... Like in @NestedSteps(PrintFormatter.class, "{$nested}"
I hope you get the idea. I want to control the formatting of nested steps.
By the way, is there a way we can provide our own listener to listen to JGiven steps???
The text was updated successfully, but these errors were encountered: