Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for GEDCOM export error handling #43

Merged

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Jul 28, 2024

Purpose

This pull request adds a unit test to ensure that the GEDCOM exporter command handles file write errors gracefully.

Description

The changes in this pull request include:

  1. Added a new unit test class GedcomExporterTest that extends the base TestCase class.
  2. In the setUp() method, the test case fakes the local storage using Storage::fake('local').
  3. Added a new test method testHandlingOfFileWriteErrors() that mocks the Storage::put() method to throw an exception, and then asserts that the GEDCOM export command outputs the expected error message and exits with a non-zero status code.
  4. Added a tearDown() method to close the Mockery instance and call the parent's tearDown() method.

Summary

The changes in this pull request include:

  • Added a new GedcomExporterTest unit test class
  • Implemented a test case to ensure the GEDCOM exporter handles file write errors
  • Mocked the Storage::put() method to throw an exception
  • Asserted the expected error message and exit code of the GEDCOM export command

Suggested changes from Sweep Chat by @curtisdelicata. Continue chatting at https://sweep-chat-demo.vercel.app/c/daa6c803-2d05-428b-be8d-8d7baa695217.

@curtisdelicata curtisdelicata merged commit 08a55ba into main Jul 28, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant