ProjectTestEnvironment

open class ProjectTestEnvironment(val projectCache: ProjectCache, names: List<String>, testLocation: TestLocation = TestLocation.get()) : TestEnvironment, ProjectCollector(source)

A specialized TestEnvironment for project-related tests. Provides utility functions for creating files and dependencies.

Constructors

Link copied to clipboard
constructor(projectCache: ProjectCache, names: List<String>, testLocation: TestLocation = TestLocation.get())

Properties

Link copied to clipboard
Link copied to clipboard
open override val projectCache: ProjectCache
Link copied to clipboard
Link copied to clipboard
open override val root: File
Link copied to clipboard
open override val workingDir: File

Functions

Link copied to clipboard
fun McProject.addDependency(configurationName: ConfigurationName, project: McProject, asTestFixture: Boolean = false)

Adds a project dependency to the receiver McProject.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun androidLibrary(path: String, androidPackage: String, config: McProjectBuilder<AndroidLibraryPluginBuilder>.() -> Unit): McProject
Link copied to clipboard
open fun androidTest(path: String, androidPackage: String, config: McProjectBuilder<AndroidTestPluginBuilder>.() -> Unit): McProject
Link copied to clipboard
Link copied to clipboard
open override fun String.cleanOutput(): String
Link copied to clipboard
fun McProject.createJavaFile(content: String, sourceSetName: SourceSetName = SourceSetName.MAIN): JavaFile

Creates a JavaFile and adds it to the receiver McProject.

fun ProjectTestEnvironment.createJavaFile(content: String, project: McProject = simpleProject(), sourceSetName: SourceSetName = SourceSetName.MAIN, jvmTarget: JvmTarget = JvmTarget.JVM_11): JavaFile

Creates a JavaFile and adds it to the specified McProject.

Link copied to clipboard
fun McProject.createKotlinFile(content: String, sourceSetName: SourceSetName = SourceSetName.MAIN): KotlinFile

Creates a KotlinFile and adds it to the receiver McProject.

fun ProjectTestEnvironment.createKotlinFile(content: String, project: McProject = simpleProject(), sourceSetName: SourceSetName = SourceSetName.MAIN, jvmTarget: JvmTarget = JvmTarget.JVM_11): KotlinFile

Creates a KotlinFile and adds it to the specified McProject.

Link copied to clipboard
Link copied to clipboard
open operator fun File.invoke(text: () -> String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open suspend fun resolveReferences()
Link copied to clipboard
open infix fun <T, U : T> T.shouldBe(expected: U?)
open infix fun String.shouldBe(expected: String)
open infix fun Sequence<*>.shouldBe(expected: List<*>)
Link copied to clipboard
open infix fun String.shouldBeNoTrimIndent(expected: String)
Link copied to clipboard
open infix override fun File.shouldHaveText(expected: String)
Link copied to clipboard
open fun simpleProject(buildFileText: String?, path: String): McProject
Link copied to clipboard
open override fun tearDown()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <T, U : T> T.trimmedShouldBe(expected: U?, vararg excludeFromStack: KClass<*>)
Link copied to clipboard