From c42bd31977d601a743a154cf5a614459b51a3cb3 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Wed, 25 Jan 2017 09:46:29 +0900 Subject: 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. --- railties/test/application/configuration_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'railties/test/application') 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 -- cgit v1.2.3