I want to write a Spek test in Kotlin. The test should read an HTML file from the src/test/resources folder. How to do it?
src/test/resources
class MySpec : Spek({
Kotlin + Spring way:
@Autowired private lateinit var resourceLoader: ResourceLoader fun load() { val html = resourceLoader.getResource("classpath:html/file.html").file .readText(charset = Charsets.UTF_8) }