Skip to content

Commit e5a6e95

Browse files
committed
Debug: More inspections
1 parent 7cafc61 commit e5a6e95

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/rubygems/test_gem_command_manager.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ def test_find_command_unknown_suggestions
8080
message = "Unknown command pish".dup
8181

8282
if defined?(DidYouMean)
83+
assert_operator Gem::UnknownCommandError, :<, DidYouMean::Correctable
84+
assert_operator Gem::UnknownCommandError, :instance_variable_defined?, :@attached
85+
assert_send [Gem::UnknownCommandError, :instance_variable_get, :@attached]
8386
message << "\nDid you mean? \"push\""
8487
end
8588

@@ -90,10 +93,10 @@ def test_find_command_unknown_suggestions
9093
end
9194

9295
assert_equal message, actual_message, proc {|msg|
93-
msg + {
94-
unknown_command: e.unknown_command,
95-
spell_checker: e.spell_checker,
96-
corrections: e.corrections,
96+
(msg || "") + {
97+
unknown_command: e.unknown_command,
98+
spell_checker: (e.spell_checker rescue nil),
99+
corrections: (e.corrections rescue nil),
97100
}.pretty_inspect
98101
}
99102
end

0 commit comments

Comments
 (0)