Skip to content

0.5.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 19:39
7a1848a

Added

  • @Sample, in the new product UnderstudySamples: on a struct, it writes static func sample(...), with one parameter per stored property, each with a default, so a test gets a complete value in one call, such as Product.sample(price: 0). @SampleDefault(value) sets a property's default. The sample is written for debug builds only, and is as visible as the struct.
  • CallOrder { ... }, which watches every spy in a block of Watched(spy, as: name) lines, for Spy and ThrowingSpy alike. watch(_:as:) stays, for a spy the test starts watching later.
  • @Recorded, a property wrapper that spies on a property whose first value is at its declaration: @Recorded var user = "ana", with $user its PropertySpy. It works in doubles written by hand and in @GenerateSpies classes, next to @SpiedProperty, and a @GenerateSpies class may have @Recorded properties only. @GenerateSpies refuses it on an actor, where @SpiedProperty is the way.

Fixed

  • Understudy now asks for swift-syntax 602 or later. It said 600, but the macros don't build with 600, and 601 gives a wrong extra error for a @SpiedProperty with accessors, so a project that resolved either got a broken Understudy.