Skip to content

Latest commit

 

History

History
115 lines (79 loc) · 3.27 KB

CHANGELOG.md

File metadata and controls

115 lines (79 loc) · 3.27 KB

1.25 (2015-08-10)

  • Make sure Diffable.forFields[T] is consistent with T.equals

1.24 (2015-08-10)

  • containElements has been dropped in favor of traversable diffables
  • Improved formatting of traversable matchers

1.23 (2015-07-16)

  • Improved readability of failure messages

1.22 (2015-07-15)

  • Improved readability of failure messages

1.21 (2015-07-13)

  • Improved readability of failure messages

1.20 (2015-07-13)

  • Removed useless trait Formatters

1.19 (2015-07-13)

  • Fix Diffable generation for polymorphic case classes (such as TupleN)

1.18 (2015-07-13)

  • Add a Diffable[Set[T]]

1.17 (2015-07-12)

  • Split matchete into multiple artefacts:

    • matchete-junit (depends on core)
    • matchete-json (depends on core)
    • matchete-xml (depends on core)
    • matchete-core (depends on macros)
    • matchete-macros

    People should therefore change their dependency toward matchete-junit.

1.16 (2015-06-26)

  • Removed MatcherComparator[Seq[T]] in favor of Diffable[Seq[T]] as the latest is more composable

1.15 (2015-06-19)

  • Added JSON matchers:

    """{
      |  "firstName": "john",
      |  "lastName":"doe", "age":43
      |}
    """.stripMargin must equalJson(
    """{
      |  "nationality": "cowboy",
      |  "firstName": "john doe"
      |}
    """.stripMargin)

1.14 (2015-06-19)

  • Fixed build configuration, the published matchete POM was incorrect and the macros weren't published.

1.13 (2015-06-19)

  • Collection matchers now accept TraversableOnce, which make it possible to match against an Iterator

1.12 (2015-06-18)

  • Added diffable support. Comparisons of case classes are now done on a field by field basis.

      case class Person(name: String, age: Int, address: Address)
      case class Address(street: String)
    
      Person("john",12, Address("street")) must_== Person("john",12,Address("different street"))    

    Will throw the following ComparisonFailure (with JunitMatchers):

      org.junit.ComparisonFailure: Person(john,12,Address(street)) is not equal to Person(john,12,Address(different street))
      address.street = street ≠ address.street = different street 
      Expected :different street
      Actual   :street
    

    Non case-classes are by default using standard equality but there's a facility for customization:

      class Person(val name: String, val age: Int, val address: Address)
      class Address(val street: String)
    
      implicit lazy val diffablePerson : Diffable[Person] = Diffable.forFields(_.name, _.age, _.address)
      implicit lazy val diffableAddress : Diffable[Address] = Diffable.forFields(_.street)
    
      new Person("john",12, new Address("street")) must_== new Person("john",12,new Address("different street"))

    Will throw the following ComparisonFailure (with JunitMatchers):

      org.junit.ComparisonFailure: org.backuity.matchete.XX$Person@46d56d67 is not equal to org.backuity.matchete.XX$Person@d8355a8
      address.street = street ≠ address.street = different street 
      Expected :different street
      Actual   :street
    

1.11 (2014-11-23)

  • Add with to exception matchers :
    parse() must throwA[ParsingError].`with`("a correct offset") { case ParsingError(msg,offset) => offset must_== 3 }