diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb index 18e612bc1b64..675e866734fd 100644 --- a/lib/rubygems/commands/owner_command.rb +++ b/lib/rubygems/commands/owner_command.rb @@ -79,7 +79,8 @@ def show_owners(name) say "Owners for gem: #{name}" owners.each do |owner| - say "- #{owner["email"] || owner["handle"] || owner["id"]}" + identifier = owner["email"] || owner["handle"] || owner["id"] + say "- #{identifier} (#{owner["role"]})" end end end diff --git a/test/rubygems/test_gem_commands_owner_command.rb b/test/rubygems/test_gem_commands_owner_command.rb index 08df696616b8..e48410ea9cd6 100644 --- a/test/rubygems/test_gem_commands_owner_command.rb +++ b/test/rubygems/test_gem_commands_owner_command.rb @@ -32,9 +32,12 @@ def test_show_owners - email: user1@example.com id: 1 handle: user1 + role: owner - email: user2@example.com + role: maintainer - id: 3 handle: user3 + role: owner - id: 4 EOF @@ -48,9 +51,9 @@ def test_show_owners assert_equal Gem.configuration.rubygems_api_key, @stub_fetcher.last_request["Authorization"] assert_match(/Owners for gem: freewill/, @stub_ui.output) - assert_match(/- user1@example.com/, @stub_ui.output) - assert_match(/- user2@example.com/, @stub_ui.output) - assert_match(/- user3/, @stub_ui.output) + assert_match(/- user1@example.com \(owner\)/, @stub_ui.output) + assert_match(/- user2@example.com \(maintainer\)/, @stub_ui.output) + assert_match(/- user3 \(owner\)/, @stub_ui.output) assert_match(/- 4/, @stub_ui.output) end