File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,15 +192,14 @@ def validate_duplicate_dependencies # :nodoc:
192192 # Checks that the gem does not depend on itself.
193193
194194 def validate_dependencies # :nodoc:
195- warning_messages = [ ]
195+ error_messages = [ ]
196196 @specification . dependencies . each do |dep |
197- if dep . name == @specification . name # warn on self reference
198- warning_messages << "Self referencing dependency is unnecessary and strongly discouraged ."
197+ if dep . name == @specification . name # error on self reference
198+ error_messages << "Dependencies of this gem include a self-reference ."
199199 end
200200 end
201- if warning_messages . any?
202- warning_messages . each { |warning_message | warning warning_message }
203- end
201+
202+ error error_messages . join if error_messages . any?
204203 end
205204
206205 def validate_required_ruby_version
Original file line number Diff line number Diff line change @@ -2812,14 +2812,13 @@ def test_validate_self_referencing_dependencies
28122812 Dir . chdir @tempdir do
28132813 @a1 . add_dependency @a1 . name , "1"
28142814
2815- use_ui @ui do
2815+ e = assert_raise Gem :: InvalidSpecificationException do
28162816 @a1 . validate
28172817 end
28182818
2819- assert_equal <<-EXPECTED , @ui . error
2820- #{ w } : Self referencing dependency is unnecessary and strongly discouraged.
2821- #{ w } : See https://guides.rubygems.org/specification-reference/ for help
2822- EXPECTED
2819+ expected = "Dependencies of this gem include a self-reference."
2820+
2821+ assert_equal expected , e . message
28232822 end
28242823 end
28252824
You can’t perform that action at this time.
0 commit comments