My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GrailsUser  
How to user Gmock with Grails
Featured
Updated Feb 25, 2010 by JohnnyJianHY

Download the jar file of Gmock from the download list, and drop it in the lib directory of your grails project. That's it. Then you can start writing your unit tests with Gmock.

Since Grails 1.2, a dependency resolution mechanism is introduced. You can simply specify the dependency of Gmock in the grails-app/conf/BuildConfig.groovy file of your grails project as below:

grails.project.dependency.resolution = {
    ...
    repositories {        
        grailsPlugins()
        grailsHome()
        mavenCentral() // Gmock is in the Maven Central Repository
    }
    dependencies {
        test 'org.gmock:gmock:0.8.0'
        test 'org.hamcrest:hamcrest-library:1.1' // Optionally, you can use hamcrest matchers
        ...
    }
}

Sign in to add a comment
Powered by Google Project Hosting