Support "play" label with @WithGMock AST Transformation

29 views
Skip to first unread message

Johnny Jian

unread,
Oct 24, 2009, 10:45:37 AM10/24/09
to gmock-dev
Inspired by the Spock framework, I have an idea of supporting a "play"
label with the @WithGMock AST Transformation.

For example:

void testPlayLabel() {
def mock = mock()
mock.fun().returns(1)

play:
assertEquals 1, mock.fun()
}

can be transformed into:

void testPlayLabel() {
def mock = mock()
mock.fun().returns(1)

play {
assertEquals 1, mock.fun()
}
}

This can give the users an option to organize the code in a "flat"
structure.

Any thoughts?

Julien

unread,
Nov 24, 2009, 2:50:18 AM11/24/09
to gmock-dev
I had a look at spock. We don't have to copy it we are just having
different philosophie.

To make it explicit we would have to had a verify: step as well.
Humm.
Reply all
Reply to author
Forward
0 new messages