Skip to content

Commit

Permalink
Clarify autorestore behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers authored Jan 26, 2024
1 parent 2928de0 commit c71033c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Dotenv.load('file1.env', 'file2.env')

## Autorestore in tests

Since 3.0, dotenv in a Rails app will automatically restore `ENV` to its original state before each test. This means you can modify `ENV` in your tests without fear of leaking state to other tests. It works with both `ActiveSupport::TestCase` and `Rspec`.
Since 3.0, dotenv in a Rails app will automatically restore `ENV` after each test. This means you can modify `ENV` in your tests without fear of leaking state to other tests. It works with both `ActiveSupport::TestCase` and `Rspec`.

To disable this behavior, set `config.dotenv.autorestore = false` in `config/application.rb` or `config/environments/test.rb`.

Expand Down

0 comments on commit c71033c

Please sign in to comment.