more verbose test output possible?

3,008 views
Skip to first unread message

Frank Weber

unread,
Aug 3, 2009, 11:51:03 AM8/3/09
to Spock Framework
I got the following output when running mvn test on the simple story
at the end of this email.

Is this a feature, or can this be configured / displayed more verbose?
I am used to something like expected 10, was 1 or similar.


Regards,

Frank

Test Report in the console:

Running groovy.StorySpock
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.14
sec <<< FAILURE!

Results :

Failed tests:
credit account(groovy.StorySpock)

Tests run: 3, Failures: 1, Errors: 0, Skipped: 0



<<<<<<<< StorySpock.groovy >>>>>>>>>>>>>>
import spock.lang.*
import static spock.lang.Predef.*

@Speck
@RunWith(Sputnik)
public class StorySpock {

def "credit account"() {

given: "an empty bank account"
def account = 0

when: "the account is credited USD 10"
account = account + 10

then: "the account's balance is USD 10"
account == 1
}

}

Peter Niederwieser

unread,
Aug 3, 2009, 12:06:43 PM8/3/09
to spockfr...@googlegroups.com
This is a Maven feature. Per default, Maven writes test results to a
file, but not to the console. To change that, add the following to
your POM:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useFile>false</useFile>
</configuration>
</plugin>

Now you should see immediately what went wrong.

Cheers,
Peter
Reply all
Reply to author
Forward
0 new messages