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

KON-118 Allow Nullable Expression Inside Assert Method #92

Merged
merged 4 commits into from
Apr 26, 2023

Conversation

igorwojda
Copy link
Contributor

@igorwojda igorwojda commented Apr 26, 2023

Allow nullable expressions inside assert and assertNot methods

The it.primaryConstructor is nullable:

Before

@Test
    fun `value class has parameter named 'value' 2`() {
        KoScope.fromProjectFiles()
            .classes()
            .withValueModifier()
            .assert { it.primaryConstructor?.hasParameterNamed("value") ?: false }  // <- HERE
    }

After

@Test
    fun `value class has parameter named 'value' 2`() {
        KoScope.fromProjectFiles()
            .classes()
            .withValueModifier()
            .assert { it.primaryConstructor?.hasParameterNamed("value") }  // <- HERE 
    }

@jira-ticket-bot
Copy link

jira-ticket-bot bot commented Apr 26, 2023

@igorwojda igorwojda marked this pull request as ready for review April 26, 2023 05:22
@igorwojda igorwojda changed the title KON-80 Allow Nullable Expression Inside Assert Method KON-80 Allow Nullable Expression Inside Assert Method (#92 Apr 26, 2023
@igorwojda igorwojda merged commit f64e62c into main Apr 26, 2023
@igorwojda igorwojda deleted the KON-80-allow-nullable-expression-inside-assert-method branch April 26, 2023 05:23
@nataliapeterwas nataliapeterwas changed the title KON-80 Allow Nullable Expression Inside Assert Method (#92 KON-118 Allow Nullable Expression Inside Assert Method Oct 2, 2023
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

Successfully merging this pull request may close these issues.

1 participant