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

exception in action results in green test #176

Closed
robstoll opened this issue Feb 2, 2017 · 5 comments
Closed

exception in action results in green test #176

robstoll opened this issue Feb 2, 2017 · 5 comments

Comments

@robstoll
Copy link
Contributor

robstoll commented Feb 2, 2017

The error can be reproduced by the following code:

describe("error sceenario"){
    on("exception thrown in action block"){
        throw IllegalArgumentException("oh no...")
        test("on should be red not green"){}
    }
}

The on should not be green (I am using intellij) but red and an exception should be shown.

@robstoll
Copy link
Contributor Author

robstoll commented Feb 2, 2017

Hm... I realised that it also happens if one of the test fails. Am I using on wrong?
And why does the whole setup screw up if an exception is thrown in a group scope? I have several describe in my test and if one of them contain an unexpected exception all of them cannot be executed. Following the code to reproduce the error:

describe("throws an exception") {
    throw IllegalArgumentException("oh no...")
}
 describe("should be executed nonetheless") {
    it("should be green") {}
}

@raniejade
Copy link
Member

@robstoll It's a limitation of the plugin, unfortunately (raniejade/spek-idea-plugin#29). If you're using gradle everything should work as expected. I'm looking into ways to fixing this, but it might take a while.

@robstoll
Copy link
Contributor Author

robstoll commented Feb 2, 2017

@raniejade you are right, it works fine in gradle, at least my first concern (described in the issue). However, my second concern (described in my comment) still holds. If an unexpected exception occurs in a group scope then none of the tests are executed. Is this intentional?

@raniejade
Copy link
Member

@robstoll No, it's not. Re-opening the ticket, it should still continue and just ignore the failing group.

@raniejade raniejade reopened this Feb 3, 2017
raniejade added a commit that referenced this issue Feb 19, 2017
Ignore failing groups during discovery phase. Passing groups will now
be properly discovered by Spek.

Resolves #176.
@robstoll
Copy link
Contributor Author

Awesome, when is your next release planned?

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