groovy - How to use gradle file tree in groovyTestcase -


i migrating project ant gradle. want write simple test case using groovetest framework. trying use gradle project.filetree interface in groovytestcase, how ever not able resolve it. same piece of code works in "test" task in build.gradle.

here simple test case like.

import org.gradle.api.project import org.gradle.api.file.filetree class  installscripttest extends groovytestcase {          void testcounnt(){             def tree = project.filetree("${project.projectdir}"){                 include '**/install*.sh'             }          }  } 

i following error when run gradle build. groovy.lang.missingpropertyexception: no such property: project class: installscripttest

i have added gradleapi dependency in build.gradle file below.

dependencies {     testcompile 'org.codehaus.groovy:groovy-test:2.4.3'        testcompile 'junit:junit:4.12'     testcompile gradleapi() } 


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -