Check plugin name with version spec in has_plugin

If one passes a version spec to `Vagrant.has_plugin?`, the actual plugin name is ignored and any installed plugin which matches the version spec makes the check pass. Fix this by also checking for plugin name match in addition to the requested version spec.
This commit is contained in:
mbrodala 2015-01-20 08:37:22 +01:00
parent 4cd767afcc
commit cca19f8241
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ module Vagrant
Plugin::Manager.instance.installed_specs.any? do |s|
match = s.name == name
next match if !version
next version.satisfied_by?(s.version)
next match && version.satisfied_by?(s.version)
end
end