Best Spek code snippet using org.spekframework.intellij.domain.ScopeDescriptorCache.getSuperClass
ScopeDescriptorCache.kt
Source:ScopeDescriptorCache.kt
...137 }138 return null139 }140 private fun isSpekSubclass(element: KtClassOrObject): Boolean {141 val superClass = getSuperClass(element)142 val fqName = superClass?.getKotlinFqName()143 if (fqName != null) {144 if (SPEK_CLASSES.contains(fqName.toString())) {145 return true146 } else {147 return isSpekSubclass(superClass)148 }149 }150 return false151 }152 private fun getSuperClass(element: KtClassOrObject): KtClassOrObject? {153 val superTypes = element.superTypeListEntries154 var superClass: KtClassOrObject? = null155 for (entry in superTypes) {156 if (entry is KtSuperTypeCallEntry) {157 val ref = entry.calleeExpression.constructorReferenceExpression158 ?.mainReference159 ?.resolve()160 superClass = when (ref) {161 is KtPrimaryConstructor -> ref.getContainingClassOrObject()162 is KtClass -> ref163 else -> null164 }165 if (superClass != null) {166 break...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!