1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Revert "Sync did_you_mean"

This reverts commit 946dadd3f4,
which broke `TestGemRequire` and others.
This commit is contained in:
Nobuyoshi Nakada 2020-05-12 16:22:41 +09:00
parent 317fdd6df2
commit ee518cf077
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
6 changed files with 2 additions and 80 deletions

View file

@ -137,11 +137,4 @@ class MethodNameCheckTest < Test::Unit::TestCase
assert_correction :yield, error.corrections
assert_match "Did you mean? yield", error.to_s
end
def test_does_not_suggest_yield
error = assert_raise(NoMethodError) { 1.yeild }
assert_correction [], error.corrections
assert_not_match(/Did you mean\? +yield/, error.to_s)
end if RUBY_ENGINE != "jruby"
end

View file

@ -1,30 +0,0 @@
require_relative '../helper'
class RequirePathCheckTest < Test::Unit::TestCase
include DidYouMean::TestHelper
def test_load_error_from_require_has_suggestions
error = assert_raise LoadError do
require 'open_struct'
end
assert_correction 'ostruct', error.corrections
assert_match "Did you mean? ostruct", error.to_s
end
def test_load_error_from_require_for_nested_files_has_suggestions
error = assert_raise LoadError do
require 'net/htt'
end
assert_correction 'net/http', error.corrections
assert_match "Did you mean? net/http", error.to_s
error = assert_raise LoadError do
require 'net-http'
end
assert_correction ['net/http', 'net/https'], error.corrections
assert_match "Did you mean? net/http", error.to_s
end
end

View file

@ -3,7 +3,6 @@ require_relative './helper'
class VerboseFormatterTest < Test::Unit::TestCase
def setup
require_relative File.join(DidYouMean::TestHelper.root, 'verbose')
DidYouMean.formatter = DidYouMean::VerboseFormatter.new
end