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

Disallow duplicate names within the same context #20

Open
npryce opened this issue Dec 21, 2018 · 0 comments
Open

Disallow duplicate names within the same context #20

npryce opened this issue Dec 21, 2018 · 0 comments

Comments

@npryce
Copy link
Collaborator

npryce commented Dec 21, 2018

Either tests with the same name, subcontexts with the same name, or a test with the same name as a subcontext.

    @org.junit.jupiter.api.Test
    fun `names are unique within a context`() {
        assertFailsWith<IllegalArgumentException>("tests") {
            rootContext<Unit> {
                test("nameclash") {}
                test("nameclash") {}
            }.buildNode()
        }
        assertFailsWith<IllegalArgumentException>("contexts") {
            rootContext<Unit> {
                context("nameclash") {}
                context("nameclash") {}
            }.buildNode()
        }
        assertFailsWith<IllegalArgumentException>("context and test") {
            rootContext<Unit> {
                context("nameclash") {}
                test("nameclash") {}
            }.buildNode()
        }
    }
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