Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming collision on generated fakes #57

Closed
afonsograca opened this issue Apr 17, 2023 · 1 comment
Closed

Naming collision on generated fakes #57

afonsograca opened this issue Apr 17, 2023 · 1 comment

Comments

@afonsograca
Copy link

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!

@SalomonBrys
Copy link
Member

Fix released in v1.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants