Class HamcrestFacade

java.lang.Object
org.spockframework.runtime.HamcrestFacade

public abstract class HamcrestFacade extends Object
Facade around Hamcrest API that works both with Hamcrest 1.1 and 1.2, providing better failure descriptions if the latter is available. HamcrestFacade.isMatcher() can safely be called no matter if Hamcrest classes are available on the class path. The remaining methods assume that Hamcrest classes are available.
Author:
Peter Niederwieser
  • Constructor Details

    • HamcrestFacade

      public HamcrestFacade()
  • Method Details

    • isMatcher

      public static boolean isMatcher(Object obj)
    • matches

      public static boolean matches(Object matcher, Object value)
    • getFailureDescription

      public static String getFailureDescription(Object matcher, Object value, String message)