Class DataTableHasTheSameRowsAs

java.lang.Object
org.hamcrest.BaseMatcher<DataTable>
org.hamcrest.TypeSafeDiagnosingMatcher<DataTable>
io.cucumber.datatable.matchers.DataTableHasTheSameRowsAs
All Implemented Interfaces:
org.hamcrest.Matcher<DataTable>, org.hamcrest.SelfDescribing

@API(status=STABLE) public final class DataTableHasTheSameRowsAs extends org.hamcrest.TypeSafeDiagnosingMatcher<DataTable>
Matches two data tables by their rows. By default the matcher does not take row order into account. This can be fluently enabled.
 assertThat(identical, hasTheSameRowsAs(table).inOrder());
 assertThat(shuffled, hasTheSameRowsAs(table));
 
  • Field Details

    • expectedValue

      private final DataTable expectedValue
    • unordered

      private final boolean unordered
  • Constructor Details

    • DataTableHasTheSameRowsAs

      private DataTableHasTheSameRowsAs(DataTable expectedValue, boolean unordered)
  • Method Details

    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • matchesSafely

      protected boolean matchesSafely(DataTable item, org.hamcrest.Description description)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeDiagnosingMatcher<DataTable>
    • inOrder

      public DataTableHasTheSameRowsAs inOrder()
      Compare the rows of the data table in order.
      Returns:
      a new matcher that compares the rows of the data table in order.
    • hasTheSameRowsAs

      public static DataTableHasTheSameRowsAs hasTheSameRowsAs(DataTable operand)