mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Docs and spec cleanup
This commit is contained in:
parent
d3078d14de
commit
a25ae50bc1
2 changed files with 8 additions and 2 deletions
|
@ -349,6 +349,12 @@ to one of the values specified in the url allowlist like so:
|
||||||
DatabaseCleaner.url_allowlist = ['postgres://postgres@localhost', 'postgres://foo@bar']
|
DatabaseCleaner.url_allowlist = ['postgres://postgres@localhost', 'postgres://foo@bar']
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Allowlist elements may be specified as regular expressions if extra flexibility is required::
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
DatabaseCleaner.url_allowlist = [%r{^postgres://postgres@localhost}]
|
||||||
|
```
|
||||||
|
|
||||||
## COPYRIGHT
|
## COPYRIGHT
|
||||||
|
|
||||||
See [LICENSE](LICENSE) for details.
|
See [LICENSE](LICENSE) for details.
|
||||||
|
|
|
@ -86,7 +86,7 @@ module DatabaseCleaner
|
||||||
describe 'A remote url is not on the allowlist' do
|
describe 'A remote url is not on the allowlist' do
|
||||||
let(:database_url) { 'postgress://bar.baz' }
|
let(:database_url) { 'postgress://bar.baz' }
|
||||||
|
|
||||||
it 'raises a allowlist error' do
|
it 'raises a not allowed error' do
|
||||||
expect { cleaner.start }.to raise_error(Safeguard::Error::UrlNotAllowed)
|
expect { cleaner.start }.to raise_error(Safeguard::Error::UrlNotAllowed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -94,7 +94,7 @@ module DatabaseCleaner
|
||||||
describe 'A similar url not explicitly matched as a pattern' do
|
describe 'A similar url not explicitly matched as a pattern' do
|
||||||
let(:database_url) { 'postgres://foo.bar?pool=8' }
|
let(:database_url) { 'postgres://foo.bar?pool=8' }
|
||||||
|
|
||||||
it 'raises an allowlist error' do
|
it 'raises a not allowed error' do
|
||||||
expect { cleaner.start }.to raise_error(Safeguard::Error::UrlNotAllowed)
|
expect { cleaner.start }.to raise_error(Safeguard::Error::UrlNotAllowed)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue