Created
December 29, 2014 17:37
-
-
Save johnrengelman/a497cc558022d2cb9457 to your computer and use it in GitHub Desktop.
Injected Gradle Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyTask extends DefaultTask { | |
@Inject | |
FileResolver fileResolver | |
@TaskAction | |
public void action() { | |
//... | |
} | |
} | |
class MyTaskSpec extends Specification { | |
def 'test task'() { | |
given: | |
def task = project.tasks.myTask | |
task.fileResolver = Mock(FileResolver) | |
when: | |
//... | |
then: | |
//... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just lovely - thx