summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_doctor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_doctor.rb')
-rw-r--r--test/rubygems/test_gem_doctor.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_doctor.rb b/test/rubygems/test_gem_doctor.rb
index a0e3a18d7f..75d406ac88 100644
--- a/test/rubygems/test_gem_doctor.rb
+++ b/test/rubygems/test_gem_doctor.rb
@@ -153,6 +153,34 @@ This directory does not appear to be a RubyGems repository, skipping
assert true # count
end
+ def test_doctor_badly_named_plugins
+ gem 'a'
+
+ Gem.use_paths @gemhome.to_s
+
+ FileUtils.mkdir_p Gem.plugins_dir
+ bad_plugin = File.join(Gem.plugins_dir, "a_badly_named_file.rb")
+ write_file bad_plugin
+
+ doctor = Gem::Doctor.new @gemhome
+
+ capture_io do
+ use_ui @ui do
+ doctor.doctor
+ end
+ end
+
+ # refute_path_exists bad_plugin
+
+ expected = <<-OUTPUT
+Checking #{@gemhome}
+Removed file plugins/a_badly_named_file.rb
+
+ OUTPUT
+
+ assert_equal expected, @ui.output
+ end
+
def test_gem_repository_eh
doctor = Gem::Doctor.new @gemhome