Skip to content

Latest commit

 

History

History
159 lines (99 loc) · 5.01 KB

CHANGELOG.md

File metadata and controls

159 lines (99 loc) · 5.01 KB

Nimble-Snapshots

4.4.2

  • Adds support for Carthage (Swift 3.0) - @juolgon & @lascorbe

4.4.1

  • Adds support for Carthage (Swift 2.3) - @juolgon & @lascorbe

4.4.0

  • Adds support for testing dynamic sizes - @bruno.mazzo

    You need the use the new subspec to enjoy this new feature:

    pod 'Nimble-Snapshots/DynamicSize'

    Then you can use the new haveValidDynamicSizeSnapshot and recordDynamicSizeSnapshot matchers to use it:

    let sizes = ["SmallSize": CGSize(width: 44, height: 44),
                 "MediumSize": CGSize(width: 88, height: 88),
                 "LargeSize": CGSize(width: 132, height: 132)]
    
    // expect(view).to(recordDynamicSizeSnapshot(sizes: sizes))
    expect(view).to(haveValidDynamicSizeSnapshot(sizes: sizes))
    
    // You can also just test some sizes:
    expect(view).to(haveValidDynamicSizeSnapshot(sizes: sizes))
    
    // If you prefer the == syntax, we got you covered too:
    expect(view) == dynamicSizeSnapshot(sizes: sizes)
    expect(view) == dynamicSizeSnapshot(sizes: sizes)

    By default, the size will be set on the view using the frame property. To change this behavior you can use the ResizeMode enum:

    public enum ResizeMode {
      case frame
      case constrains
      case block(resizeBlock: (UIView, CGSize)->())
      case custom(ViewResizer: ViewResizer)
    }

    To use the enum you can expect(view) == dynamicSizeSnapshot(sizes: sizes, resizeMode: newResizeMode). For custom behavior you can use ResizeMode.block. The block will be call on every resize. Or you can implement the ViewResizer protocol and resize yourself. The custom behavier can be use to record the views too.

For more info on usage, check the dynamic sizes tests.

  • Improved failure messages by removing the prefix ", got" - @MP0w

4.3.0

  • Adds support for testing dynamic type - @marcelofabri

    You need the use the new subspec to enjoy this new feature:

    pod 'Nimble-Snapshots/DynamicType'

    Then you can use the new haveValidDynamicTypeSnapshot and recordDynamicTypeSnapshot matchers to use it:

    // expect(view).to(recordDynamicTypeSnapshot()
    expect(view).to(haveValidDynamicTypeSnapshot())
    
    // You can also just test some sizes:
    expect(view).to(haveValidDynamicTypeSnapshot(sizes: [UIContentSizeCategoryExtraLarge]))
    
    // If you prefer the == syntax, we got you covered too:
    expect(view) == dynamicTypeSnapshot()
    expect(view) == dynamicTypeSnapshot(sizes: [UIContentSizeCategoryExtraLarge])

    Note that this will post an UIContentSizeCategoryDidChangeNotification, so your views/view controllers need to observe that and update themselves.

    For more info on usage, check the dynamic type tests.

  • Removes support for Xcode 7.3 and Swift 2.2 - @marcelofabri

  • Adds Swift 2.3/3.0 support - @carezone

4.1.0

  • Adds tolerance so you can specify tolerance of reference image differences – @mpurland

4.0.1

  • Adds recordSnapshot(name=nil) so you can use expect(thing) == recordSnapshot() as this feels much nicer than writing expect(thing).to( recordSnapshot() ) - I'm still not over this to( thing() )' bit in Quick. Looks messy. - @orta

4.0.0

  • Nimble-Snapshots does not call view?.drawViewHierarchyInRect(bounds, afterScreenUpdates: true) on your views by default. - @orta

    If this is something that you need in order to get your snapshots passing, you should look at two options:

    • Adding the view to an existing window, then calling drawViewHierarchyInRect:afterScreenUpdates: - this is the technique that is used inside FBSnapshotTestController, which we now expose as an option in recordSnapshot and haveValidSnapshot as usesDrawRect

          expect(imageView).to( recordSnapshot(usesDrawRect: true) )
          expect(imageView).to( haveValidSnapshot(usesDrawRect: true) )

      You can get more info on the technique on this issue

    • Spending time looking in how you can remove Async code from your App. Or look for places where you are relying on a view structure which isn't set up in your tests. There are a bunch of examples in https://github.com/orta/pragmatic-testing on removing Async.

3.0.1

  • Loosens dependency version. - @alesker

3.0.0

  • Calls through to drawViewHierarchyInRect on every snapshot prior to snapshot being made – @ashfurrow

2.0.1

  • Disables bitcode – @ashfurrow

2.0.0

  • Name sanitizing, custom folders and more housekeeping - @colinta

1.2.0

  • Device diagnostic code – @esttorhe

1.0.0

  • Swift 2 support - @tibr

0.4

  • Updates Quick and Numble to latest (requires Xcode 6.3+) - @andreamazz

0.3

  • Adds pretty syntax support for snapshots with unspecified names - @ashfurrow

0.2

  • Ensure all ReferenceImages folders are in the same root folder - @orta

0.1

  • Updated to official repos of Quick and Nimble for beta 5 support - @ashfurrow