JetBrains IntelliJ Gradle Dependencies Plugin

Specification run results

View on GitHub

Init script

As a user I would like to be able inject a Script into a Gradle.

Total Runs Success Rate Failures Errors Skipped Total time (ms)
4 100.0% 0 0 0 0.030 seconds

TestSubject:

Issues:

See:

Features


should return temporary init script path with replaced plugin path

Result: PASS Time: 0.020 seconds

def initScript = '/gradle-dependencies-plugin.gradle'
@Subject
InitScriptInjector testSubject = new InitScriptInjector(initScript, 'plugin')
def path = testSubject.getAbsolutePath()
Files.exists(Path.of(path))
def lines = Files.readAllLines(Path.of(path))
checkPluginPath(lines)
checkPluginName(lines, 'plugin')
testSubject.close()
noExceptionThrown()

should remove temporary init script when close is invoked

Result: PASS Time: 0.001 seconds

def initScript = '/gradle-dependencies-plugin.gradle'
@Subject
InitScriptInjector testSubject = new InitScriptInjector(initScript, 'test')
def path = testSubject.getAbsolutePath()
Files.exists(Path.of(path))
testSubject.close()
!Files.exists(Path.of(path))
noExceptionThrown()

should not create a temporary init script

Result: PASS Time: 0

def initScript = '/gradle-dependencies-plugin.gradle'
@Subject
InitScriptInjector testSubject = new InitScriptInjector(initScript, 'test')
testSubject.close()
noExceptionThrown()

should throw exception when not existent init script is provided

Result: PASS Time: 0

def initScript = '/test.gradle'
@Subject
InitScriptInjector testSubject = new InitScriptInjector(initScript, 'test')
testSubject.getAbsolutePath()
thrown(NullPointerException)