Skip to content

0.15.0: Man of Few Birds

Compare
Choose a tag to compare
@andrewchang-bird andrewchang-bird released this 13 Aug 19:49
· 73 commits to master since this release
0.15.0
50feb5e

Targets

  • Xcode 11.6 / Swift 5.2
  • iOS 8.0+, macOS 10.14+, tvOS 9.0+

Migrating from 0.14

Generic Mock Initialization

This release unifies the mock initialization API for generic types.

class MyClass {}
protocol MyProtocol {}

class MyGenericClass<T> {}
protocol MyGenericProtocol {
  associatedtype T
}

// Old
mock(MyClass.self)
mock(MyProtocol.self)

mock(MyGenericClassMock<Bool>.self)
mock(MyGenericProtocolMock<Bool>.self)

// New
mock(MyClass.self)     // no change
mock(MyProtocol.self)  // no change

mock(MyGenericClass<Bool>.self)
mock(MyGenericProtocol<Bool>.self)

Value Provider Semantics

Value provider has been simplified and no longer allows for hierarchical composition and decomposition.

// Old
var provider = ValueProvider()
provider.addSubprovider(.standardProvider)
provider.removeSubprovider(.standardProvider)

// New (mutating)
var provider = ValueProvider()
provider.add(.standardProvider)

// New (non-mutating)
let provider = ValueProvider() + .standardProvider
let provider = ValueProvider().adding(.standardProvider)

New Features

Enhancements