From 5c18b63d0058d3d4acfce3588c3b47f3ae6c46bd Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Sat, 28 Sep 2024 14:57:59 -0400 Subject: [PATCH] [rubygems/rubygems] [tests] Don't expect suggestions that aren't actually helpful. https://github.com/rubygems/rubygems/commit/e7d6b92e31 --- test/rubygems/test_gem_commands_exec_command.rb | 5 +---- test/rubygems/test_gem_spec_fetcher.rb | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/rubygems/test_gem_commands_exec_command.rb b/test/rubygems/test_gem_commands_exec_command.rb index fd48ce73ca..c632ce62b2 100644 --- a/test/rubygems/test_gem_commands_exec_command.rb +++ b/test/rubygems/test_gem_commands_exec_command.rb @@ -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 diff --git a/test/rubygems/test_gem_spec_fetcher.rb b/test/rubygems/test_gem_spec_fetcher.rb index cb4a4f7204..b7c88b22f9 100644 --- a/test/rubygems/test_gem_spec_fetcher.rb +++ b/test/rubygems/test_gem_spec_fetcher.rb @@ -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