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

Plain class boolean parsing not working #65

Closed
AndreasVolkmann opened this issue Aug 19, 2021 · 0 comments · Fixed by #66
Closed

Plain class boolean parsing not working #65

AndreasVolkmann opened this issue Aug 19, 2021 · 0 comments · Fixed by #66
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AndreasVolkmann
Copy link
Collaborator

AndreasVolkmann commented Aug 19, 2021

The following test fails:

// Arrange
class Configuration(val headless: Boolean = false)

// Act
val config = Arkenv.parse<Configuration>(arrayOf("--headless", "true"))

// Assert
expectThat(config) { get { headless }.isTrue() }

This does work with delegates, just not with plain classes.

The parsing fails because it attempts to map the value, but no boolean mapping is available.

@AndreasVolkmann AndreasVolkmann added the bug Something isn't working label Aug 19, 2021
@AndreasVolkmann AndreasVolkmann added this to the 3.3.2 milestone Aug 19, 2021
@AndreasVolkmann AndreasVolkmann self-assigned this Aug 19, 2021
@AndreasVolkmann AndreasVolkmann mentioned this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant