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

Script inside _construct not working #31

Open
tsuharesu opened this issue Mar 21, 2019 · 1 comment
Open

Script inside _construct not working #31

tsuharesu opened this issue Mar 21, 2019 · 1 comment

Comments

@tsuharesu
Copy link

I'm using this with Kotlin data classes, they don't have default constructors. Since I can use _construct this shouldn't be a problem. However, when trying to create a class with a script ${sequence.number}, Beanmother gives an exception that my class doesn't have a default constructor.

This works:

valid_account:
  _construct:
    - 1 # Int
    - Roxo # String
    - 'BRL 0.00' # BigMoney

This doesn't:

valid_account:
  _construct:
    - ${sequence.number} # Int
    - Roxo # String
    - 'BRL 0.00' # BigMoney

Is this the correct behavior? Shouldn't scripts work anywhere?

@tsuharesu
Copy link
Author

If I got it correctly, the problem is that handleScriptFixtureValue(fixtureMap); only runs after the object is already constructed, inside _bear methods.

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

1 participant