зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] [tests] Don't expect suggestions that aren't actually helpful.
https://github.com/rubygems/rubygems/commit/e7d6b92e31
This commit is contained in:
Родитель
47a3482a41
Коммит
5c18b63d00
|
@ -493,7 +493,6 @@ class TestGemCommandsExecCommand < Gem::TestCase
|
|||
assert_equal 2, e.exit_code
|
||||
assert_equal <<~ERR, @ui.error
|
||||
ERROR: Could not find a valid gem 'a' (= 2) in any repository
|
||||
ERROR: Possible alternatives: a
|
||||
ERR
|
||||
end
|
||||
end
|
||||
|
@ -574,7 +573,6 @@ class TestGemCommandsExecCommand < Gem::TestCase
|
|||
assert_include @ui.output, "a (= 2) not available locally"
|
||||
assert_equal <<~ERROR, @ui.error
|
||||
ERROR: Could not find a valid gem 'a' (= 2) in any repository
|
||||
ERROR: Possible alternatives: a
|
||||
ERROR
|
||||
end
|
||||
end
|
||||
|
@ -769,8 +767,7 @@ class TestGemCommandsExecCommand < Gem::TestCase
|
|||
assert_raise Gem::MockGemUi::TermError do
|
||||
invoke "a"
|
||||
end
|
||||
assert_equal "ERROR: Could not find a valid gem 'a' (>= 0) in any repository\n" \
|
||||
"ERROR: Possible alternatives: a\n", @ui.error
|
||||
assert_equal "ERROR: Could not find a valid gem 'a' (>= 0) in any repository\n", @ui.error
|
||||
assert_empty @ui.output
|
||||
assert_empty @installed_specs
|
||||
end
|
||||
|
|
|
@ -168,20 +168,20 @@ class TestGemSpecFetcher < Gem::TestCase
|
|||
def test_suggest_gems_from_name_latest
|
||||
spec_fetcher do|fetcher|
|
||||
fetcher.spec "example", 1
|
||||
fetcher.spec "other-example", 1
|
||||
fetcher.spec "an-example", 1
|
||||
fetcher.spec "examp", 1
|
||||
end
|
||||
|
||||
suggestions = @sf.suggest_gems_from_name("examplw", :latest, 1)
|
||||
assert_equal ["example"], suggestions
|
||||
|
||||
suggestions = @sf.suggest_gems_from_name("other")
|
||||
assert_equal ["other-example"], suggestions
|
||||
suggestions = @sf.suggest_gems_from_name("anexample")
|
||||
assert_equal ["an-example"], suggestions
|
||||
|
||||
suggestions = @sf.suggest_gems_from_name("exam")
|
||||
suggestions = @sf.suggest_gems_from_name("xample")
|
||||
assert suggestions.any? { ["examp"] }
|
||||
assert suggestions.any? { ["example"] }
|
||||
assert suggestions.any? { ["other-example"] }
|
||||
assert suggestions.any? { ["an-example"] }
|
||||
end
|
||||
|
||||
def test_suggest_gems_from_name_prerelease
|
||||
|
|
Загрузка…
Ссылка в новой задаче