{"repo":"krzysztofzablocki/Difference","free":true,"listed":false,"github":"https://github.com/krzysztofzablocki/Difference","clone":"git clone https://github.com/krzysztofzablocki/Difference.git","description":"Simple way to identify what is different between 2 instances of any type. Must have for TDD.","language":"Swift","stars":1244,"topics":["testing","ios","swift","macos","watchos","tvos"],"license":"MIT","category":"mobile-apps","readme_excerpt":"Difference Better way to identify what's different between 2 instances. Have you ever written tests? Usually they use equality asserts, e.g. XCTAssertEqual , what happens if the objects aren't equal? Xcode throws a wall of text at you: This forces you to manually scan the text and try to figure out exactly what's wrong, what if instead you could just learn which property is different? If you'd like to support my work and improve your engineering workflows, check out my SwiftyStack course Installation CocoaPods Add pod 'Difference' to your Podfile. Carthage Add github \"krzysztofzablocki/Difference\" to your Cartfile. SwiftPM Add .package(url: \"https://github.com/krzysztofzablocki/Difference.git\", branch: \"master\") dependency in your Package manifest. Using lldb Write the following to see the difference between 2 instances: po dumpDiff(expected, received) Integrate with XCTest Add this to your test target: Replace #filePath with #file if you're using Xcode 11 or earlier. Integrate with Quick Add this to your test target: Write the following to see the difference between 2 instances: expect(received).to(equalDiff(expected)) Integrate with The Composable Architecture If you are using The Composable Architecture nameLabels configuration to get a diff that's more appropiate for reducer instrumentation You can use this function in your own variant of ReducerInstrumentation code based on this That way your diffs will look more like this:","default_branch":null,"files":null,"tree":[],"storefront":"/r/krzysztofzablocki","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/krzysztofzablocki/Difference/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}