From 65e6342a4ff05d5254f153191f3536e5e2e054ff Mon Sep 17 00:00:00 2001 From: Fletcher Nichol Date: Sun, 29 Mar 2015 17:13:37 -0600 Subject: [PATCH] Add plugin metadata to Driver. This commit adds 2 new peices of metadata: plugin version and driver API version. --- kitchen-vagrant.gemspec | 2 +- lib/kitchen/driver/vagrant.rb | 5 +++++ spec/kitchen/driver/vagrant_spec.rb | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kitchen-vagrant.gemspec b/kitchen-vagrant.gemspec index 318f9d82..9d96003a 100644 --- a/kitchen-vagrant.gemspec +++ b/kitchen-vagrant.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |gem| gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.add_dependency "test-kitchen", "~> 1.4.0.beta.1" + gem.add_dependency "test-kitchen", "~> 1.4.0.rc.1" gem.add_development_dependency "countloc", "~> 0.4" gem.add_development_dependency "rake" diff --git a/lib/kitchen/driver/vagrant.rb b/lib/kitchen/driver/vagrant.rb index 0bdecf3c..dc90465b 100644 --- a/lib/kitchen/driver/vagrant.rb +++ b/lib/kitchen/driver/vagrant.rb @@ -21,6 +21,7 @@ require "rubygems/version" require "kitchen" +require "kitchen/driver/vagrant_version" module Kitchen @@ -33,6 +34,10 @@ class Vagrant < Kitchen::Driver::Base include ShellOut + kitchen_driver_api_version 2 + + plugin_version Kitchen::Driver::VAGRANT_VERSION + default_config(:box) { |driver| driver.default_box } required_config :box diff --git a/spec/kitchen/driver/vagrant_spec.rb b/spec/kitchen/driver/vagrant_spec.rb index 973fe5c3..e994de61 100644 --- a/spec/kitchen/driver/vagrant_spec.rb +++ b/spec/kitchen/driver/vagrant_spec.rb @@ -68,6 +68,15 @@ driver_object.class.send(:vagrant_version=, nil) end + it "driver api_version is 2" do + expect(driver.diagnose_plugin[:api_version]).to eq(2) + end + + it "plugin_version is set to Kitchen::Vagrant::VERSION" do + expect(driver.diagnose_plugin[:version]).to eq( + Kitchen::Driver::VAGRANT_VERSION) + end + describe "configuration" do context "for known bento platform names" do