I have an odd idea (well, its not mine, but I digress).
}
I'd like to be able to extract a few things out. At the end of the when: block, I'd like to get a list (somehow...) of the interactions that have occurred. As in the expressions.
Similarly, I'd like to get the expressions that have been executed in the then or expect and be able to process them.
The idea is to generate documentation of the form
----
Some poll
given a poll between Red, Green, Blue
when 4 votes added to Red, 1 vote added to Green, 1 vote added to Blue
then 10 total votes, Red is the winner
-----
I'm suspecting that I'll be deep in AST land, which is fine. I just wanted to get a handle on if this might be possible in some way?
The actual conversion of expressions into documentation is something I've got specced out. Its the hook into spock to get those expressions that I'm wondering about.
I've checked the AST after conversion, and the labels are still available. I was wondering if you had any thoughts on a second AST transform hooking into the code part way through spocks ? (it might be a horrific idea :-) )
Or could this be handled another way?
Best,
David.