JBehave
  1. JBehave
  2. JBEHAVE-288

Replace Ensure methods with Hamcrest direct invocations

    Details

    • Type: Task Task
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: Core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Ensure is a very thin layer over Hamcrest, with very little benefit apart from using "ensure" terminology in place of "assert". The ensureThat(boolean) method can be confusing too. Better to allow direct use of Hamcrest or other libraries to enable the assertion or verification.

        Activity

        Mauro Talevi made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Resolution Fixed [ 1 ]
        Hide
        Brian Repko added a comment -

        Not sure that these are needed - they are part of JUnit - I just tell people to ignore them and use JUnit's Asserts

        Show
        Brian Repko added a comment - Not sure that these are needed - they are part of JUnit - I just tell people to ignore them and use JUnit's Asserts
        Hide
        Mauro Talevi added a comment -

        Precisely my point. One should be able to use any assertion library one prefers, Hamcrest, JUnit, etc ...

        Show
        Mauro Talevi added a comment - Precisely my point. One should be able to use any assertion library one prefers, Hamcrest, JUnit, etc ...
        Hide
        Brian Repko added a comment -

        Ah, got it - perfect - thanks, Mauro.

        Show
        Brian Repko added a comment - Ah, got it - perfect - thanks, Mauro.
        Hide
        Mani added a comment -

        I noticed the EnsureThat class does not exist from versions 3.0.0 onwards, can someone guide me through how I can use Hamcrest to supplement the usage? A couple of examples will be great.

        Thanks,
        Mani

        Show
        Mani added a comment - I noticed the EnsureThat class does not exist from versions 3.0.0 onwards, can someone guide me through how I can use Hamcrest to supplement the usage? A couple of examples will be great. Thanks, Mani
        Hide
        Mauro Talevi added a comment -

        Hamcrest is just a library that you may or may not use in JBehave. You can learn more from its website: http://hamcrest.org/

        Examples of using Hamcrest-based assertion can be found in many places, including the JBehave code: https://github.com/jbehave/jbehave-core

        Show
        Mauro Talevi added a comment - Hamcrest is just a library that you may or may not use in JBehave. You can learn more from its website: http://hamcrest.org/ Examples of using Hamcrest-based assertion can be found in many places, including the JBehave code: https://github.com/jbehave/jbehave-core

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Mauro Talevi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: