1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix warning: character class has duplicated range

This fixes the following warnings:

```
railties/test/generators/encrypted_secrets_generator_test.rb:15: warning: character class has duplicated range: /[\w\d]+/
railties/test/generators/encrypted_secrets_generator_test.rb:18: warning: character class has duplicated range: /production:\n#  external_api_key: [\w\d]+/
railties/test/generators/encrypted_secrets_generator_test.rb:19: warning: character class has duplicated range: /production:\n#  external_api_key: [\w\d]+/
```
This commit is contained in:
yuuji.yaginuma 2017-03-20 07:30:45 +09:00
parent 9cc2f50f9c
commit 6dfe25a86c

View file

@ -12,11 +12,11 @@ class EncryptedSecretsGeneratorTest < Rails::Generators::TestCase
def test_generates_key_file_and_encrypted_secrets_file
run_generator
assert_file "config/secrets.yml.key", /[\w\d]+/
assert_file "config/secrets.yml.key", /\w+/
assert File.exist?("config/secrets.yml.enc")
assert_no_match(/production:\n# external_api_key: [\w\d]+/, IO.binread("config/secrets.yml.enc"))
assert_match(/production:\n# external_api_key: [\w\d]+/, Rails::Secrets.read)
assert_no_match(/production:\n# external_api_key: \w+/, IO.binread("config/secrets.yml.enc"))
assert_match(/production:\n# external_api_key: \w+/, Rails::Secrets.read)
end
def test_appends_to_gitignore