मैं कोटलिन में एक स्पेक टेस्ट लिखना चाहता हूं। परीक्षण को src/test/resourcesफ़ोल्डर से एक HTML फ़ाइल पढ़नी चाहिए । यह कैसे करना है?
class MySpec : Spek({
describe("blah blah") {
given("blah blah") {
var fileContent : String = ""
beforeEachTest {
// How to read the file file.html in src/test/resources/html
fileContent = ...
}
it("should blah blah") {
...
}
}
}
})
this::class.java.classLoader.getResource("/html/file.html").readText()