raniejade / spek-idea-plugin

MIT License
48 stars 15 forks source link

Test terminates if thrown error contains apostrophe #18

Closed hannesstruss closed 7 years ago

hannesstruss commented 8 years ago

Given this spec:

class ApostropheFailTest : Spek({
  describe("a test which throws an error with an apostrophe") {
    it("should fail") {
      throw AssertionError("But it doesn't")
    }
  }

  describe("a test which throws an error without an apostrophe") {
    it("should also fail") {
      throw AssertionError("And it does")
    }
  }
})

Both tests should be listed as failed in Idea, but only the second one does while the first one seems to be running indeterminately:

image

I found the difference that causes the behavior is the apostrophe (') contained in the first test's exception message.

raniejade commented 7 years ago

@hannesstruss sorry I know it's a bit too late. Are you using the JUnit 4 runner?

hannesstruss commented 7 years ago

@raniejade no worries :)

I think I'm not using JUnit 4. I did not annotate my tests with @RunWith(JUnitPlatform::class). Here's an example project which reproduces the issue: https://github.com/hannesstruss/spekplugintest

raniejade commented 7 years ago

I have a fix, going to include it the next release. For now avoid using ' in your test names and exception messages.

hannesstruss commented 7 years ago

Thanks a lot! 🙌

hannesstruss commented 7 years ago

Can confirm this is fixed in 0.3.0 – thanks again!