From 236141ba90ba494819a9e4756e52787837d70bd8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 4 Dec 2013 11:29:17 -0800 Subject: [PATCH] commands/plugin: old state files default to 0 for vagrant version --- plugins/commands/plugin/state_file.rb | 4 +++- test/unit/plugins/commands/plugin/state_file_test.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/commands/plugin/state_file.rb b/plugins/commands/plugin/state_file.rb index 51684256f..c1543bc8f 100644 --- a/plugins/commands/plugin/state_file.rb +++ b/plugins/commands/plugin/state_file.rb @@ -64,7 +64,9 @@ module VagrantPlugins new_installed = {} (@data["installed"] || []).each do |plugin| - new_installed[plugin] = {} + new_installed[plugin] = { + "vagrant_version" => "0", + } end @data["installed"] = new_installed diff --git a/test/unit/plugins/commands/plugin/state_file_test.rb b/test/unit/plugins/commands/plugin/state_file_test.rb index dd394c788..4610428b3 100644 --- a/test/unit/plugins/commands/plugin/state_file_test.rb +++ b/test/unit/plugins/commands/plugin/state_file_test.rb @@ -61,7 +61,9 @@ describe VagrantPlugins::CommandPlugin::StateFile do end it "should have the right installed plugins" do - subject.installed_plugins.keys.should eql(["foo"]) + plugins = subject.installed_plugins + expect(plugins.keys).to eql(["foo"]) + expect(plugins["foo"]["vagrant_version"]).to eql("0") end end end