Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kabiroberai committed May 4, 2023
1 parent f676fbe commit 810ad99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 0 additions & 13 deletions Tests/SentryTests/SentryOptionsTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -1156,19 +1156,6 @@ - (void)testInitialScope {
XCTAssertIdentical(initialScope, options.initialScope);
}

- (void)testConfigureInitialScope {
SentryOptions *options = [self getValidOptions:@{}];
options.initialScope = ^(SentryScope *scope) {
[scope setUser:[[SentryUser alloc] initWithUserId:@"me"]];
return scope;
};

SentryScope *scope = options.initialScope([[SentryScope alloc] initWithMaxBreadcrumbs:123]);

XCTAssertEqual(@"me", scope.userObject.userId);
XCTAssertEqual(123, [(id)scope maxBreadcrumbs]);
}

- (SentryOptions *)getValidOptions:(NSDictionary<NSString *, id> *)dict
{
NSError *error = nil;
Expand Down
6 changes: 5 additions & 1 deletion Tests/SentryTests/SentrySDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ class SentrySDKTests: XCTestCase {
scope.setUser(User(userId: "me"))
SentrySDK.start { options in
options.dsn = SentrySDKTests.dsnAsString
options.initialScope = { _ in scope }
options.maxBreadcrumbs = 123
options.initialScope = { suggested in
XCTAssertEqual(123, Dynamic(suggested).maxBreadcrumbs)
return scope
}
}
XCTAssertEqual("me", SentrySDK.currentHub().scope.userObject?.userId)
XCTAssertIdentical(scope, SentrySDK.currentHub().scope)
Expand Down

0 comments on commit 810ad99

Please sign in to comment.