Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/rubygems/commands/owner_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions test/rubygems/test_gem_commands_owner_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
Loading