Skip to main content

Difference

Simple way to identify what is different between 2 instances of any type. Must have for TDD.

Details

URL: 🔗 https://github.com/krzysztofzablocki/Difference

Authors: Krzysztof Zabłocki

Tags:
swift, ios, testing, macos, tvos, watchos

Key Points​

  • Provides a streamlined method to identify differences between two instances of any type, beneficial for Test-Driven Development (TDD).
  • Improves upon standard equality assertions in testing frameworks like XCTest by highlighting exactly what properties or values differ.
  • Supports integration with XCTest, Quick, and The Composable Architecture for enhanced testing capabilities.

Summary of Contents​

  • Introduction: Introduces the need for a clearer way to identify differences in test results.
  • Installation: Instructions for integrating the Difference library via CocoaPods, Carthage, or Swift Package Manager.
  • Using lldb: Explains how to use po dumpDiff(expected, received) to view differences in instances during debugging.
  • Integrate with XCTest: Provides code snippets for integrating with XCTest to enhance assertion messages.
  • Integrate with Quick: Guides on integrating with the Quick testing framework to improve error messages for assertions.
  • Integrate with The Composable Architecture: Demonstrates integration with a specific architecture for more detailed state comparison.
  • Conclusion: Emphasizes the benefits of using Difference to streamline debugging and improve testing efficiency.
Go to Github Repository→