From e2313ca3bc8636841010a133f3c69ae26b090029 Mon Sep 17 00:00:00 2001 From: Bryan McLellan Date: Mon, 18 May 2015 15:45:53 -0400 Subject: [PATCH] Test against Chef 11, and Chef 12+ in Travis --- .gitignore | 1 + .travis.yml | 18 +++++++++++++++--- Gemfile | 7 +------ knife-windows.gemspec | 2 -- travis.gemfile | 15 +++++++++++++++ 5 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 travis.gemfile diff --git a/.gitignore b/.gitignore index 4040c6c1..9adbd462 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.gem .bundle Gemfile.lock +travis.gemfile.lock pkg/* diff --git a/.travis.yml b/.travis.yml index 16e6d977..786daf74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,18 @@ +language: ruby + rvm: + - 1.9.3 - 2.0.0 - - 2.1.5 - - 2.2.0 + - 2.1.0 + +gemfile: travis.gemfile + +env: + - CHEF_VERSION="master" + - CHEF_VERSION="< 12" + +matrix: + exclude: + - rvm: 1.9.3 + env: CHEF_VERSION="master" -script: bundle exec rake spec diff --git a/Gemfile b/Gemfile index 559eb436..4f108370 100644 --- a/Gemfile +++ b/Gemfile @@ -3,13 +3,8 @@ source "https://rubygems.org" # Specify your gem's dependencies in knife-windows.gemspec gemspec -# TODO: Remove this line when a new version of `winrm-s` is released which contains: -# -# https://github.com/chef/winrm-s/commit/d9a85d7c93ef4c24faaea760cdc58a3532d599e9 -# -gem 'winrm-s', github: 'chef/winrm-s' - group :test do + gem "chef" gem "rspec", '~> 3.0' gem "ruby-wmi" gem "httpclient" diff --git a/knife-windows.gemspec b/knife-windows.gemspec index 0fe5b178..e0b3da08 100644 --- a/knife-windows.gemspec +++ b/knife-windows.gemspec @@ -18,9 +18,7 @@ Gem::Specification.new do |s| s.add_dependency "winrm-s", "~> 0.3.0.dev.0" s.add_dependency "nokogiri" - s.add_development_dependency 'pry' - s.add_development_dependency 'chef', '< 12' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") diff --git a/travis.gemfile b/travis.gemfile new file mode 100644 index 00000000..7c77d4b0 --- /dev/null +++ b/travis.gemfile @@ -0,0 +1,15 @@ +source "https://rubygems.org" + +# Specify your gem's dependencies in knife-windows.gemspec +gemspec + +if ENV['CHEF_VERSION'] == 'master' + gem 'chef', github: 'chef/chef' +else + gem 'chef', ENV['CHEF_VERSION'] +end + +gem "rspec", '~> 3.0' +gem "ruby-wmi" +gem "httpclient" +gem 'rake'