aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/command
diff options
context:
space:
mode:
authorGenadi Samokovarov <gsamokovarov@gmail.com>2018-03-17 15:55:44 +0200
committerGenadi Samokovarov <gsamokovarov@gmail.com>2018-03-23 11:36:03 +0200
commitcb25f2c989588edf77f978820196b4446e01ffe8 (patch)
tree0dd189e6496b065194ec99a04b5c3e3651449031 /railties/test/command
parentef73318e29666786feb00e9e9b3b49a771bb0b73 (diff)
downloadrails-cb25f2c989588edf77f978820196b4446e01ffe8.tar.gz
rails-cb25f2c989588edf77f978820196b4446e01ffe8.tar.bz2
rails-cb25f2c989588edf77f978820196b4446e01ffe8.zip
Use `did_you_mean` spell checker for option suggestions
Now that we require Ruby over `2.3`, we can replace the current suggestion methods we have with tooling from the `did_you_mean` gem. There is a small user visible change and this is that we now offer a single suggestion for misspelled options. We are suggesting fixes during generator invocation and during a mistyped rails server rack handler. In both cases, if we don't make a proper prediction on the first match, we won't do so in the second or third one, so in my mind, this is okay.
Diffstat (limited to 'railties/test/command')
-rw-r--r--railties/test/command/spellchecker_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/test/command/spellchecker_test.rb b/railties/test/command/spellchecker_test.rb
index aff50a3e73..e6a7a3957c 100644
--- a/railties/test/command/spellchecker_test.rb
+++ b/railties/test/command/spellchecker_test.rb
@@ -5,6 +5,6 @@ require "rails/command/spellchecker"
class Rails::Command::SpellcheckerTest < ActiveSupport::TestCase
test "suggests a word correction from dictionary" do
- assert_equal %w(thin cgi puma), Rails::Command::Spellchecker.suggest("tin", from: %w(puma thin cgi))
+ assert_equal "thin", Rails::Command::Spellchecker.suggest("tin", from: %w(puma thin cgi))
end
end