diff --git a/src/test/groovy/ru/vyarus/gradle/plugin/python/GlobalEnvironmentKitTest.groovy b/src/test/groovy/ru/vyarus/gradle/plugin/python/GlobalEnvironmentKitTest.groovy new file mode 100644 index 0000000..a8afa0b --- /dev/null +++ b/src/test/groovy/ru/vyarus/gradle/plugin/python/GlobalEnvironmentKitTest.groovy @@ -0,0 +1,36 @@ +package ru.vyarus.gradle.plugin.python + +import org.gradle.testkit.runner.BuildResult +import org.gradle.testkit.runner.TaskOutcome +import spock.lang.TempDir + +/** + * @author Vyacheslav Rusakov + * @since 05.04.2024 + */ +class GlobalEnvironmentKitTest extends AbstractKitTest { + + @TempDir File envDir + + def "Check module override"() { + setup: + build """ + plugins { + id 'ru.vyarus.use-python' + } + + python { + envPath = "${envDir.absolutePath.replace('\\\\', '\\\\\\\\')}" + pip 'extract-msg:0.28.1', 'extract-msg:0.28.0' + } + + """ + + when: "run task" + BuildResult result = run('pipInstall') + + then: "task successful" + result.task(':pipInstall').outcome == TaskOutcome.SUCCESS + result.output =~ /extract-msg\s+0.28.0/ + } +}