core: plugin manager marks system gems as system

This commit is contained in:
Mitchell Hashimoto 2014-03-03 14:55:34 -08:00
parent efddef0a80
commit b5637da6c4
2 changed files with 9 additions and 1 deletions

View File

@ -114,7 +114,13 @@ module Vagrant
#
# @return [Hash]
def installed_plugins
system = @system_file ? @system_file.installed_plugins : {}
system = {}
if @system_file
@system_file.installed_plugins.each do |k, v|
system[k] = v.merge("system" => true)
end
end
system.merge(@user_file.installed_plugins)
end

View File

@ -214,7 +214,9 @@ describe Vagrant::Plugin::Manager do
expect(plugins.length).to eql(2)
expect(plugins).to have_key("foo")
expect(plugins["foo"]["gem_version"]).to eq("0.1.0")
expect(plugins["foo"]["system"]).to be_false
expect(plugins).to have_key("bar")
expect(plugins["bar"]["system"]).to be_true
end
end
end