From d86d9c3d63c5bd9f17b592288dd9ebc67f9aa314 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 26 Oct 2022 10:40:21 -0800 Subject: [PATCH] fix various typos --- Sources/Sentry/SentryCoreDataTracker.m | 8 ++-- .../Helper/SentrySwizzleWrapperTests.swift | 40 +++++++++---------- ...entryUIEventTrackingIntegrationTests.swift | 18 ++++----- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Sources/Sentry/SentryCoreDataTracker.m b/Sources/Sentry/SentryCoreDataTracker.m index 28d58d9bef..eeca890eab 100644 --- a/Sources/Sentry/SentryCoreDataTracker.m +++ b/Sources/Sentry/SentryCoreDataTracker.m @@ -108,11 +108,11 @@ - (NSString *)descriptionForOperations: __block NSMutableArray *resultParts = [NSMutableArray new]; void (^operationInfo)(NSUInteger, NSString *) = ^void(NSUInteger total, NSString *op) { - NSDictionary *itens = operations[op]; - if (itens && itens.count > 0) { - if (itens.count == 1) { + NSDictionary *items = operations[op]; + if (items && items.count > 0) { + if (items.count == 1) { [resultParts addObject:[NSString stringWithFormat:@"%@ %@ '%@'", op, - itens.allValues[0], itens.allKeys[0]]]; + items.allValues[0], items.allKeys[0]]]; } else { [resultParts addObject:[NSString stringWithFormat:@"%@ %lu items", op, (unsigned long)total]]; diff --git a/Tests/SentryTests/Helper/SentrySwizzleWrapperTests.swift b/Tests/SentryTests/Helper/SentrySwizzleWrapperTests.swift index 152582eb07..b6f946987d 100644 --- a/Tests/SentryTests/Helper/SentrySwizzleWrapperTests.swift +++ b/Tests/SentryTests/Helper/SentrySwizzleWrapperTests.swift @@ -2,7 +2,7 @@ import XCTest extension SentrySwizzleWrapper { - static func hasItens() -> Bool { + static func hasItems() -> Bool { guard let result = Dynamic(self).hasCallbacks as Bool? else { return false } @@ -42,70 +42,70 @@ class SentrySwizzleWrapperTests: XCTestCase { } func testSendAction_RegisterCallbacks_CallbacksCalled() { - let firstExcpectation = expectation(description: "first") + let firstExpectation = expectation(description: "first") sut.swizzleSendAction({ actualAction, _, _, actualEvent in XCTAssertEqual(self.fixture.actionName, actualAction) XCTAssertEqual(self.fixture.event, actualEvent) - firstExcpectation.fulfill() + firstExpectation.fulfill() }, forKey: "first") - let secondExcpectation = expectation(description: "second") + let secondExpectation = expectation(description: "second") sut.swizzleSendAction({ actualAction, _, _, actualEvent in XCTAssertEqual(self.fixture.actionName, actualAction) XCTAssertEqual(self.fixture.event, actualEvent) - secondExcpectation.fulfill() + secondExpectation.fulfill() }, forKey: "second") sendActionCalled() - wait(for: [firstExcpectation, secondExcpectation], timeout: 0.1) + wait(for: [firstExpectation, secondExpectation], timeout: 0.1) } func testSendAction_RegisterCallbackForSameKey_LastCallbackCalled() { - let firstExcpectation = expectation(description: "first") - firstExcpectation.isInverted = true + let firstExpectation = expectation(description: "first") + firstExpectation.isInverted = true sut.swizzleSendAction({ _, _, _, _ in - firstExcpectation.fulfill() + firstExpectation.fulfill() }, forKey: "first") - let secondExcpectation = expectation(description: "second") + let secondExpectation = expectation(description: "second") sut.swizzleSendAction({ actualAction, _, _, actualEvent in XCTAssertEqual(self.fixture.actionName, actualAction) XCTAssertEqual(self.fixture.event, actualEvent) - secondExcpectation.fulfill() + secondExpectation.fulfill() }, forKey: "first") sendActionCalled() - wait(for: [firstExcpectation, secondExcpectation], timeout: 0.1) + wait(for: [firstExpectation, secondExpectation], timeout: 0.1) } func testSendAction_RemoveCallback_CallbackNotCalled() { - let firstExcpectation = expectation(description: "first") - firstExcpectation.isInverted = true + let firstExpectation = expectation(description: "first") + firstExpectation.isInverted = true sut.swizzleSendAction({ _, _, _, _ in - firstExcpectation.fulfill() + firstExpectation.fulfill() }, forKey: "first") sut.removeSwizzleSendAction(forKey: "first") sendActionCalled() - wait(for: [firstExcpectation], timeout: 0.1) + wait(for: [firstExpectation], timeout: 0.1) } func testSendAction_AfterCallingReset_CallbackNotCalled() { - let neverExcpectation = expectation(description: "never") - neverExcpectation.isInverted = true + let neverExpectation = expectation(description: "never") + neverExpectation.isInverted = true sut.swizzleSendAction({ _, _, _, _ in - neverExcpectation.fulfill() + neverExpectation.fulfill() }, forKey: "never") sut.removeAllCallbacks() sendActionCalled() - wait(for: [neverExcpectation], timeout: 0.1) + wait(for: [neverExpectation], timeout: 0.1) } private func sendActionCalled() { diff --git a/Tests/SentryTests/Integrations/UIEvents/SentryUIEventTrackingIntegrationTests.swift b/Tests/SentryTests/Integrations/UIEvents/SentryUIEventTrackingIntegrationTests.swift index 2ab8642f45..65966f78a4 100644 --- a/Tests/SentryTests/Integrations/UIEvents/SentryUIEventTrackingIntegrationTests.swift +++ b/Tests/SentryTests/Integrations/UIEvents/SentryUIEventTrackingIntegrationTests.swift @@ -32,50 +32,50 @@ class SentryUIEventTrackerIntegrationTests: XCTestCase { clearTestState() } - func test_noInstallion_SwizzlingDisabled() { + func test_noInstallation_SwizzlingDisabled() { let sut = fixture.getSut() sut.install(with: fixture.optionForUIEventTracking(enableSwizzling: false)) assertNoInstallation(sut) - XCTAssertFalse(SentrySwizzleWrapper.hasItens()) + XCTAssertFalse(SentrySwizzleWrapper.hasItems()) } func test_noInstallation_AutoPerformanceDisabled() { let sut = fixture.getSut() sut.install(with: fixture.optionForUIEventTracking(enableAutoPerformanceTracking: false)) assertNoInstallation(sut) - XCTAssertFalse(SentrySwizzleWrapper.hasItens()) + XCTAssertFalse(SentrySwizzleWrapper.hasItems()) } - func test_noInstallation_UserInterationDisabled() { + func test_noInstallation_UserInteractionDisabled() { let sut = fixture.getSut() sut.install(with: fixture.optionForUIEventTracking(enableUserInteractionTracing: false)) assertNoInstallation(sut) - XCTAssertFalse(SentrySwizzleWrapper.hasItens()) + XCTAssertFalse(SentrySwizzleWrapper.hasItems()) } func test_noInstallation_NoSampleRate() { let sut = fixture.getSut() sut.install(with: fixture.optionForUIEventTracking(tracesSampleRate: 0)) assertNoInstallation(sut) - XCTAssertFalse(SentrySwizzleWrapper.hasItens()) + XCTAssertFalse(SentrySwizzleWrapper.hasItems()) } func test_Installation() { let sut = fixture.getSut() sut.install(with: fixture.optionForUIEventTracking()) XCTAssertNotNil(Dynamic(sut).uiEventTracker as SentryUIEventTracker?) - XCTAssertTrue(SentrySwizzleWrapper.hasItens()) + XCTAssertTrue(SentrySwizzleWrapper.hasItems()) } func test_Uninstall() { let sut = fixture.getSut() sut.install(with: fixture.optionForUIEventTracking()) XCTAssertNotNil(Dynamic(sut).uiEventTracker as SentryUIEventTracker?) - XCTAssertTrue(SentrySwizzleWrapper.hasItens()) + XCTAssertTrue(SentrySwizzleWrapper.hasItems()) sut.uninstall() - XCTAssertFalse(SentrySwizzleWrapper.hasItens()) + XCTAssertFalse(SentrySwizzleWrapper.hasItems()) } func assertNoInstallation(_ integration: SentryUIEventTrackingIntegration) {