Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshnj committed Jun 28, 2024
1 parent f8137be commit cd5a2f9
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,16 @@ class FileWriterTests: XCTestCase {
directory: directory,
performance: PerformancePreset.mockAny(),
dateProvider: SystemDateProvider(),
telemetry: NOPTelemetry()
telemetry: NOPTelemetry(),
metricsData: .init(trackName: "rum", consentLabel: .mockAny(), uploaderPerformance: UploadPerformanceMock.noOp)
),
encryption: nil,
telemetry: NOPTelemetry()
)

writer.write(value: FailingEncodableMock(errorMessage: "failed to encode `FailingEncodable`."))

XCTAssertEqual(dd.logger.errorLog?.message, "Failed to encode value")
XCTAssertEqual(dd.logger.errorLog?.message, "(rum) Failed to encode value")
XCTAssertEqual(dd.logger.errorLog?.error?.message, "failed to encode `FailingEncodable`.")
}

Expand All @@ -202,7 +203,8 @@ class FileWriterTests: XCTestCase {
directory: directory,
performance: PerformancePreset.mockAny(),
dateProvider: SystemDateProvider(),
telemetry: NOPTelemetry()
telemetry: NOPTelemetry(),
metricsData: .init(trackName: "rum", consentLabel: .mockAny(), uploaderPerformance: UploadPerformanceMock.noOp)
),
encryption: nil,
telemetry: NOPTelemetry()
Expand All @@ -213,7 +215,7 @@ class FileWriterTests: XCTestCase {
writer.write(value: ["won't be written"])
try? directory.files()[0].makeReadWrite()

XCTAssertEqual(dd.logger.errorLog?.message, "Failed to write data")
XCTAssertEqual(dd.logger.errorLog?.message, "(rum) Failed to write 26 bytes to file")
XCTAssertTrue(dd.logger.errorLog!.error!.message.contains("You don’t have permission"))
}

Expand Down

0 comments on commit cd5a2f9

Please sign in to comment.