diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-01-25 09:46:29 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2017-01-25 09:58:15 +0900 |
commit | c42bd31977d601a743a154cf5a614459b51a3cb3 (patch) | |
tree | 2d52a01d303e0ec2ca1cbb4d9eeb07e822bf2298 /railties/test/application | |
parent | c6f9f8c28a720ad4ec7cf3613dddfa451d5968e2 (diff) | |
download | rails-c42bd31977d601a743a154cf5a614459b51a3cb3.tar.gz rails-c42bd31977d601a743a154cf5a614459b51a3cb3.tar.bz2 rails-c42bd31977d601a743a154cf5a614459b51a3cb3.zip |
correctly check error message
`assert_raise` does not check error message. However, in some tests,
it seems like expecting error message checking with `assert_raise`.
Instead of specifying an error message in `assert_raise`, modify to use
another assert to check the error message.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/configuration_test.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 01a9807b6b..824831155e 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -623,9 +623,10 @@ module ApplicationTests assert_equal "", app.config.secret_token assert_nil app.secrets.secret_key_base - assert_raise ArgumentError, /\AA secret is required/ do + e = assert_raise ArgumentError do app.key_generator end + assert_match(/\AA secret is required/, e.message) end test "that nested keys are symbolized the same as parents for hashes more than one level deep" do @@ -1184,11 +1185,12 @@ module ApplicationTests end test "config.session_store with :active_record_store without activerecord-session_store gem" do - assert_raise RuntimeError, /activerecord-session_store/ do + e = assert_raise RuntimeError do make_basic_app do |application| application.config.session_store :active_record_store end end + assert_match(/activerecord-session_store/, e.message) end test "default session store initializer does not overwrite the user defined session store even if it is disabled" do |