提交 6dfe25a8 编写于 作者: Y yuuji.yaginuma

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]+/
```
上级 9cc2f50f
......@@ -12,11 +12,11 @@ def setup
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册