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

test: create test harness with locked environment #59

Merged
merged 4 commits into from
Dec 20, 2022

Commits on Dec 19, 2022

  1. test: create test harness with locked environment

    Setup single-process integration testing with a utility module. Designed
    so multiple tests can be run without the need for separate processes.
    In practice, this means new tests will not need a new file. It allows
    for easily repeating checks across similar functions e.g. `dotenv()` and
    `from_filename(".env")`.
    
    The heart of the utility module is the `TestEnv` struct which enables
    controlled setup of a temporary testing environment. When using the
    `test_in_env` functions, access to the process' environment is
    effectively locked using a mutex, reset, and then the `TestEnv` is
    created.
    
    Also included:
    
    - a set of default keys and values
    - valid and invalid default envfile contents
    - assertions with contextual output when tests fail
    sonro committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    e712cef View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    93fc862 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    61e1594 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dd9c5d7 View commit details
    Browse the repository at this point in the history