Questions tagged [quick-nimble]

Nimble is a "Matcher Framework" for Swift and Objective-C, maintained by the team behind the Quick testing framework.

Definition:

Nimble is a Matcher Framework for Swift and Objective-C.

In other words, you can use Nimble to express the expected outcomes of Swift or Objective-C expressions.

Nimble is maintained by the team behind the Quick testing framework.

Example Usage:

// Swift

expect(2 + 2).to(equal(4))
expect(1.3).to(beCloseTo(1.2, within: 0.1))
expect(4) > 3
expect("horseradish").to(contain("horse"))
expect(["Dog", "Cat"]).toNot(contain("Mouse"))
expect(bedsheet.isClean).toEventually(beTruthy())

Important Links:

58 questions
0
votes
0 answers

Fastlane scan launches a new test session while current test session is not finished

I have some test cases failing due to a new test session started during this test case execution. This makes the current test case crashing. As you can see in the provided logs, there is a first test session launched: [16:42:35]: ▸ 2019-10-22…
0
votes
2 answers

OCMock class category not working as expected

I have the following UIImage category: @implementation UIImage (Exception) + (nullable UIImage *)imageCanThrowWithData:(NSData *)data error:(NSError **)errorPtr { UIImage *image = nil; @try { image = [self imageWithData:data]; …
Zsolt
  • 3,648
  • 3
  • 32
  • 47
0
votes
1 answer

Failed to import Quick/Nimble in test target with cocoapods

Problem: Suddenly my test target from the project created with Xcode 10 started failing with message "import Quick could not find module". Additional details: If I would not build the main target, the test target would fail at…
Fawkes
  • 3,831
  • 3
  • 22
  • 37
0
votes
0 answers

Setup authentication headers within a test using Quick

I'm writing tests for my application with usage of Quick and Nimble. I've arrived at the part of the tests that require authentication. My app works in a manner that there's a singleton named AuthenticationManager that has methods for logging in…
ilikecode
  • 391
  • 3
  • 14
0
votes
0 answers

Kiwi framework equivalent in Quick Nimble framework

describe(@"URServiceDiscoveryWrapper", ^{ context(@"method getHomeCountryWithCompletion:", ^{ __block id mockedServiceDiscovery; beforeEach(^{ mockedServiceDiscovery = [KWMock…
0
votes
1 answer

NSManagedObjects properties always nil with Quick-Nimble

In the past, I've tested my CoreData layer in XCTests by setting up a managed object context in memory as described in this post. Basically: class func setUpInMemoryManagedObjectContext() -> NSManagedObjectContext { let managedObjectModel =…
c_booth
  • 2,185
  • 1
  • 13
  • 22
0
votes
1 answer

Swift test --filter seems to exclude everything when actually running tests

I have a swift library compiled with SwiftPM and I have two testTargets declared in my Package.swift. I would like to be able to run these two test targets independently in my CI, so I have been trying to run something like: swift test…
qqq
  • 1,360
  • 1
  • 9
  • 24
0
votes
0 answers

How to use table-driven tests in Swift with class reflection

I have a lot of Realm data models that I want to test in a Quick spec. The mechanics of the test for each model is identical: Expect the realm to be empty for the object type Load sample data from a JSON file Init the model with the JSON data Save…
davidethell
  • 11,708
  • 6
  • 43
  • 63
0
votes
2 answers

How to compare two `Any` objects those actually conform to `Equatable`

I want to implement a ValueObjectSharedExampleConfiguration: QuickConfiguration using Quick. class ValueObjectSharedExampleConf: QuickConfiguration { override class func configure(_ configuration: Configuration) { sharedExamples("Value…
Nandin Borjigin
  • 2,094
  • 1
  • 16
  • 37
0
votes
0 answers

Swift 3, Xcode 8- Test case project compilation errors

I have got a project from a company to develop where the original developers left. Project details: carthage for dependancy management Pivotal Cedar, Quick and Nimble for test case project The project was developed in Swift 2.0. I converted the…
shoan
  • 1,303
  • 15
  • 22
0
votes
3 answers

How to install Quick and Nimble in Xcode 6.3

I've tried both cocoapods and git submodules but everytime I install the framework it wont build. Has anyone been able to install it. Both quick and nimble I use the code on the master branch. I also am using Swift 1.2 with xcode 6.3. It seems…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
-1
votes
2 answers

Swift/Quick/Nimble with async/await does not compile

I am trying to write a unit test using Quick/Nimble that tests an async function, as per the Nimble documentation: await expect(await aFunctionReturning1()).to(equal(1)) Unfortunately this line does not compile for me. Environment: Xcode…
Lasse
  • 490
  • 3
  • 8
-1
votes
1 answer

API violation - multiple calls made to -[XCTestExpectation fulfill], How can i solve this problem

I'm writing unit test for my codes which using Combine framework i have a async operation, so i use expectation(descrption:) to wait async operation this is my code example class MyViewModel { private var someOtherSubject:…
PrepareFor
  • 2,448
  • 6
  • 22
  • 36
1 2 3
4