kosi-libs/MocKMP

Naming collision on generated fakes

afonsograca opened this issue · 1 comments

Hi there,

I'm using a library that contains a couple of classes like this:

data class Foo(...) {
   data class Data(...) 
}

data class Bar(...) {
   data class Data(...) 
}

When trying to write tests, I'd like to generate fakes based on those Data classes, and so I added

@UsesFakes(Foo.Data::class)

and

@UsesFakes(Bar.Data::class)

to their respective cases.

Unfortunately I get a kotlin.io.FileAlreadyExistsException where fakeData already exists. Is there a way to give a custom name to the fake? something like

@UsesFakes(Foo.Data::class as FooData)

Cheers!

Fix released in v1.14.0.