Gradle Dependencies Check

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.029 seconds

TestSubject:

Issues:

See:

Features


should throw exception when not existent init script is provided

Result: PASS Time: 0.004 seconds

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

should not create a temporary init script

Result: PASS Time: 0.001 seconds

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

should remove temporary init script when close is invoked

Result: PASS Time: 0.006 seconds

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

should return temporary init script path with replaced plugin path

Result: PASS Time: 0.009 seconds

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