I'm using Quick to test my Swift code.
However, I think it doesn't release objects defined in describe
scope:
class MyClass {
deinit {
print(self, #function)
}
}
final class MyClassSpec: QuickSpec {
override func spec() {
describe("") {
let foo = MyClass()
it("") {
print(foo)
expect(true).to(beTrue())
}
}
}
}
I don't see any output from print
inside deinit
, and a debug breakpoint inside the deinit
does not get catched.
If I move foo
inside it
, the deinit
is called.
Is this a bug in Quick, or is it normal for deinit
not to be called in a test suite?