Nimble Project Introduction
Overview
Nimble is a testing framework for Swift and Objective-C that allows developers to express expected outcomes of their code clearly and concisely. Inspired by Cedar, Nimble is designed to provide expressive, readable test assertions in your code. It helps ensure that your code behaves as expected by allowing you to use assertions like expect
to make your tests easier to understand.
// Swift examples using Nimble
expect(1 + 1).to(equal(2))
expect(1.2).to(beCloseTo(1.1, within: 0.1))
expect(3) > 2
expect("seahorse").to(contain("sea"))
expect(["Atlantic", "Pacific"]).toNot(contain("Mississippi"))
expect(ocean.isClean).toEventually(beTruthy())
Documentation
Comprehensive documentation for Nimble is available online. Users can access it through the auxiliary project page at quick.github.io/Nimble. This documentation provides users with detailed information about using Nimble effectively in their projects.
Installation Options
Nimble can be integrated into projects using several methods, ensuring flexibility and ease of use:
-
Swift Package Manager: Integration through Xcode's Swift Package Manager is straightforward, allowing you to add Nimble to your Swift project's test target by specifying its repository URL.
For instance, within your
Package.swift
file, specify Nimble like so:// swift-tools-version:5.7 import PackageDescription let package = Package( name: "MyAwesomeLibrary", dependencies: [ .package(url: "https://github.com/Quick/Nimble.git", from: "13.0.0"), ], targets: [ .testTarget( name: "MyAwesomeLibraryTests", dependencies: ["Nimble"]), ] )
-
CocoaPods: Incorporate Nimble into your project by integrating it into your
Podfile
, using theuse_frameworks!
directive to support Swift.platform :ios, '13.0' target 'YOUR_APP_NAME_HERE_Tests', :exclusive => true do use_frameworks! pod 'Nimble' end
-
Carthage: Add Nimble to your
Cartfile.private
and follow Carthage's typical setup instructions.github "Quick/Nimble" ~> 13.2
-
Git Submodules: Clone Nimble as a submodule and integrate it with your project in Xcode by linking Nimble.framework to your test target.
Privacy Statement
Nimble is designed exclusively for testing purposes and should not be included in the final binary uploaded to App Store Connect. Importantly, Nimble does not engage in collecting any user data or analytics, respecting user privacy.
Nimble effectively empowers developers to write expressive, comprehensible test scenarios for Swift and Objective-C projects, ensuring robust software performance and reliability.