summaryrefslogtreecommitdiff
path: root/test/did_you_mean/spell_checking/test_key_name_check.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/did_you_mean/spell_checking/test_key_name_check.rb')
-rw-r--r--test/did_you_mean/spell_checking/test_key_name_check.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/did_you_mean/spell_checking/test_key_name_check.rb b/test/did_you_mean/spell_checking/test_key_name_check.rb
index ea05ff69e4..2f246f04d7 100644
--- a/test/did_you_mean/spell_checking/test_key_name_check.rb
+++ b/test/did_you_mean/spell_checking/test_key_name_check.rb
@@ -8,11 +8,11 @@ class KeyNameCheckTest < Test::Unit::TestCase
error = assert_raise(KeyError) { hash.fetch(:bax) }
assert_correction ":bar", error.corrections
- assert_match "Did you mean? :bar", error.to_s
+ assert_match "Did you mean? :bar", get_message(error)
error = assert_raise(KeyError) { hash.fetch("fooo") }
assert_correction %("foo"), error.corrections
- assert_match %(Did you mean? "foo"), error.to_s
+ assert_match %(Did you mean? "foo"), get_message(error)
end
def test_corrects_hash_key_name_with_fetch_values
@@ -20,11 +20,11 @@ class KeyNameCheckTest < Test::Unit::TestCase
error = assert_raise(KeyError) { hash.fetch_values("foo", :bar, :bax) }
assert_correction ":bar", error.corrections
- assert_match "Did you mean? :bar", error.to_s
+ assert_match "Did you mean? :bar", get_message(error)
error = assert_raise(KeyError) { hash.fetch_values("foo", :bar, "fooo") }
assert_correction %("foo"), error.corrections
- assert_match %(Did you mean? "foo"), error.to_s
+ assert_match %(Did you mean? "foo"), get_message(error)
end
def test_correct_symbolized_hash_keys_with_string_value
@@ -32,13 +32,13 @@ class KeyNameCheckTest < Test::Unit::TestCase
error = assert_raise(KeyError) { hash.fetch('foo_1') }
assert_correction %(:foo_1), error.corrections
- assert_match %(Did you mean? :foo_1), error.to_s
+ assert_match %(Did you mean? :foo_1), get_message(error)
end
def test_corrects_sprintf_key_name
error = assert_raise(KeyError) { sprintf("%<foo>d", {fooo: 1}) }
assert_correction ":fooo", error.corrections
- assert_match "Did you mean? :fooo", error.to_s
+ assert_match "Did you mean? :fooo", get_message(error)
end
def test_corrects_env_key_name
@@ -46,7 +46,7 @@ class KeyNameCheckTest < Test::Unit::TestCase
ENV["BAR"] = "2"
error = assert_raise(KeyError) { ENV.fetch("BAX") }
assert_correction %("BAR"), error.corrections
- assert_match %(Did you mean? "BAR"), error.to_s
+ assert_match %(Did you mean? "BAR"), get_message(error)
ensure
ENV.delete("FOO")
ENV.delete("BAR")