markhobson / hamcrest-compose

Hamcrest matchers for composition.
Apache License 2.0
30 stars 6 forks source link

Describe nested compose matchers and mismatches with indentation #8

Open markhobson opened 9 years ago

markhobson commented 9 years ago

Nested uses of ComposeMatchers.compose lose their hierarchical context. For example:

Expected: a person with title "a" and first name "b" and last name "c" and home address is an address with street "d" and city "e"
     but: title was "x" and home address street was "y" and city was "z"

This should be improved once #7 writes matchers on separate lines:

Expected: a person with title "a"
          and first name "b"
          and last name "c"
          and home address is an address with street "d"
          and city "e"
     but: title was "x"
          and home address street was "y"
          and city was "z"

We should then try to indicate hierarchy with deep indentation:

Expected: a person with title "a"
          and first name "b"
          and last name "c"
          and home address is an address with street "d"
              and city "e"
     but: title was "x"
          and home address street was "y"
              and city was "z"