Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7474

Difference between junit3 and junit 4 shouldFail {...} not described in docs

    XMLWordPrintableJSON

Details

    Description

      Groovy language documentation chapter on junit4 (http://docs.groovy-lang.org/latest/html/documentation/#_junit_4) states that "shouldFail can be used the same way it can be used in a GroovyTestCase". In fact junit4 version returns exception while junit3 returns message.

      I've spent quite a lot of time trying to figure out why shouldFail in my code returns an exception while documentation and tests say that it returns message. It turned out that I was reading documentation for a wrong shouldFail. But I've never thought that methods in GroovyTestCase and GroovyAssert may have different signature or semantic. A small notice in documentation might help others avoid this confusion. An example for junit 4 version would be nice too.

      Attachments

        Activity

          People

            paulk Paul King
            and.dmitry Dmitry Andreychuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: