Skip to content

Conversation

lawik
Copy link
Contributor

@lawik lawik commented May 29, 2025

Add a new testing macro that allows users to assert that a file was created and test its contents using a function. This provides a more flexible API for testing file creation compared to the existing assert_creates/3 macro.

The new macro supports:

  • Pipeline-style testing with |> assert_creates_file(path, fn file -> ... end)
  • Custom assertions on file content using pattern matching and regex
  • Proper error handling and stack trace preservation

Contributor checklist

  • Bug fixes include regression tests
  • Features include unit/acceptance tests

Add a new testing macro that allows users to assert that a file was
created and test its contents using a function. This provides a more
flexible API for testing file creation compared to the existing
assert_creates/3 macro.

The new macro supports:
- Pipeline-style testing with |> assert_creates_file(path, fn file -> ... end)
- Custom assertions on file content using pattern matching and regex
- Proper error handling and stack trace preservation
end)
"""
defmacro assert_creates_file(igniter, path, fun) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should modify existing assert_creates

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.

2 participants