diff options
Diffstat (limited to 'test/did_you_mean/helper.rb')
-rw-r--r-- | test/did_you_mean/helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/did_you_mean/helper.rb b/test/did_you_mean/helper.rb index 7cb7b10282..d40d58d95d 100644 --- a/test/did_you_mean/helper.rb +++ b/test/did_you_mean/helper.rb @@ -29,5 +29,15 @@ module DidYouMean def assert_correction(expected, array) assert_equal Array(expected), array, "Expected #{array.inspect} to only include #{expected.inspect}" end + + def get_message(err) + if err.respond_to?(:detailed_message) + err.detailed_message(highlight: false) + else + err.to_s + end + end + + module_function :get_message end end |