aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorArthur Nogueira Neves <github@arthurnn.com>2017-01-30 20:16:30 -0500
committerGitHub <noreply@github.com>2017-01-30 20:16:30 -0500
commit543f19626b80e72c543306b6ca67421df3a42d6c (patch)
tree5f1c9ab0575b88f4fdd92949389d82d4cebdd3d0 /activesupport/test
parent4e5c2ccc1d97f0c18834f616fc219be6b1531bde (diff)
parentc42bd31977d601a743a154cf5a614459b51a3cb3 (diff)
downloadrails-543f19626b80e72c543306b6ca67421df3a42d6c.tar.gz
rails-543f19626b80e72c543306b6ca67421df3a42d6c.tar.bz2
rails-543f19626b80e72c543306b6ca67421df3a42d6c.zip
Merge pull request #27797 from y-yagi/correctly_check_error_message
correctly check error message
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/dependencies_test.rb3
-rw-r--r--activesupport/test/time_travel_test.rb3
2 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index 53a75f0ad4..577675ecdf 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -271,7 +271,8 @@ class DependenciesTest < ActiveSupport::TestCase
def test_raising_discards_autoloaded_constants
with_autoloading_fixtures do
- assert_raises(Exception, "arbitray exception message") { RaisesArbitraryException }
+ e = assert_raises(Exception) { RaisesArbitraryException }
+ assert_equal("arbitray exception message", e.message)
assert_not defined?(A)
assert_not defined?(RaisesArbitraryException)
end
diff --git a/activesupport/test/time_travel_test.rb b/activesupport/test/time_travel_test.rb
index cfc6447360..e0d3fb0cf5 100644
--- a/activesupport/test/time_travel_test.rb
+++ b/activesupport/test/time_travel_test.rb
@@ -94,11 +94,12 @@ class TimeTravelTest < ActiveSupport::TestCase
outer_expected_time = Time.new(2004, 11, 24, 01, 04, 44)
inner_expected_time = Time.new(2004, 10, 24, 01, 04, 44)
travel_to outer_expected_time do
- assert_raises(RuntimeError, /Calling `travel_to` with a block, when we have previously already made a call to `travel_to`, can lead to confusing time stubbing./) do
+ e = assert_raises(RuntimeError) do
travel_to(inner_expected_time) do
#noop
end
end
+ assert_match(/Calling `travel_to` with a block, when we have previously already made a call to `travel_to`, can lead to confusing time stubbing./, e.message)
end
end
end