Skip to content

Commit

Permalink
Updating for Vagrant 1.9.7 and updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Thomas committed Jul 13, 2017
1 parent c5eb522 commit a009942
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 66 deletions.
1 change: 1 addition & 0 deletions .delivery/project.toml
@@ -0,0 +1 @@
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
35 changes: 0 additions & 35 deletions .rubocop.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .travis.yml
@@ -1,8 +1,10 @@
sudo: false
dist: trusty

addons:
apt:
sources:
- chef-current-precise
- chef-current-trusty
packages:
- chefdk

Expand All @@ -11,13 +13,11 @@ install: echo "skip bundle install"

# Ensure we make ChefDK's Ruby the default
before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
# We have to install chef-sugar for ChefSpec
- /opt/chefdk/embedded/bin/chef gem install chef-sugar
- eval "$(chef shell-init bash)"
- chef --version
- cookstyle --version
- foodcritic --version
script:
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/rubocop --version
- /opt/chefdk/embedded/bin/foodcritic --version
- /opt/chefdk/embedded/bin/rake
- chef exec delivery local all
matrix:
fast_finish: true
6 changes: 2 additions & 4 deletions attributes/default.rb
Expand Up @@ -19,10 +19,8 @@

return unless %w(darwin windows linux).include?(node['os'])

DEFAULT_VERSION = '1.9.7'.freeze

default['vagrant']['version'] = DEFAULT_VERSION
default['vagrant']['msi_version'] = DEFAULT_VERSION
default['vagrant']['version'] = '1.9.7'
default['vagrant']['msi_version'] = nil

# the URL and checksum are calculated from the package version by helper methods
# in the recipe if you# don't override them in a wrapper cookbook
Expand Down
4 changes: 3 additions & 1 deletion metadata.rb
Expand Up @@ -15,7 +15,7 @@
name 'vagrant'
maintainer 'Joshua Timberman'
maintainer_email 'cookbooks@housepub.org'
license 'Apache 2.0'
license 'Apache-2.0'
description 'Installs Vagrant and provides a vagrant_plugin LWRP for installing Vagrant plugins.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.7.0'
Expand All @@ -32,3 +32,5 @@

depends 'dmg', '>= 2.2.2'
depends 'windows', '>= 1.38'

chef_version '>= 12.7'
6 changes: 2 additions & 4 deletions providers/plugin.rb
Expand Up @@ -63,10 +63,8 @@ def plugin
end

def uninstall
if current_resource.installed
converge_by("Uninstalling Vagrant plugin: #{new_resource.name} #{new_resource.version}") do
plugin.uninstall
end
converge_by("Uninstalling Vagrant plugin: #{new_resource.name}") do
plugin.uninstall
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/libraries/helpers_spec.rb
Expand Up @@ -10,7 +10,7 @@
'050411ba8b36e322c4ce32990d2539e73a87fabd932f7397d2621986084eda6a vagrant_1.7.4_i686.deb',
'f83ea56f8d1a37f3fdf24dd4d14bf8d15545ed0e39b4c1c5d4055f3de6eb202d vagrant_1.7.4_i686.rpm',
'dcd2c2b5d7ae2183d82b8b363979901474ba8d2006410576ada89d7fa7668336 vagrant_1.7.4_x86_64.deb',
'b0a09f6e6f9fc17b01373ff54d1f5b0dc844394886109ef407a5f1bcfdd4e304 vagrant_1.7.4_x86_64.rpm'
'b0a09f6e6f9fc17b01373ff54d1f5b0dc844394886109ef407a5f1bcfdd4e304 vagrant_1.7.4_x86_64.rpm',
]
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/debian_spec.rb
Expand Up @@ -7,7 +7,7 @@
version: '14.04',
file_cache_path: '/var/tmp'
) do |node|
node.set['vagrant']['version'] = '1.88.88'
node.normal['vagrant']['version'] = '1.88.88'
end.converge(described_recipe)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/recipes/default_spec.rb
Expand Up @@ -39,8 +39,8 @@

context 'with an array of plugins to install' do
it 'includes the install_plugins recipe' do
debian.node.set['vagrant']['plugins'] = ['vagrant-omnibus']
debian.node.set['vagrant']['user'] = 'vagrant'
debian.node.normal['vagrant']['plugins'] = ['vagrant-omnibus']
debian.node.normal['vagrant']['user'] = 'vagrant'
debian.converge(described_recipe)

expect(debian).to include_recipe('vagrant::install_plugins')
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/fedora_spec.rb
Expand Up @@ -5,7 +5,7 @@
cached(:chef_run) do
ChefSpec::SoloRunner.new(
platform: 'fedora',
version: '21',
version: '25',
file_cache_path: '/var/tmp'
).converge(described_recipe)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/recipes/mac_os_x_spec.rb
Expand Up @@ -7,7 +7,7 @@
version: '10.10',
file_cache_path: '/var/tmp'
) do |node|
node.set['vagrant']['version'] = '1.88.88'
node.normal['vagrant']['version'] = '1.88.88'
end.converge(described_recipe)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/recipes/rhel_spec.rb
Expand Up @@ -4,10 +4,10 @@
let(:chef_run) do
ChefSpec::SoloRunner.new(
platform: 'centos',
version: '6.6',
version: '6.9',
file_cache_path: '/var/tmp'
) do |node|
node.set['vagrant']['version'] = '1.88.88'
node.normal['vagrant']['version'] = '1.88.88'
end.converge(described_recipe)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/recipes/suse_spec.rb
Expand Up @@ -4,10 +4,10 @@
let(:chef_run) do
ChefSpec::SoloRunner.new(
platform: 'suse',
version: '12.0',
version: '12.2',
file_cache_path: '/var/tmp'
) do |node|
node.set['vagrant']['version'] = '1.88.88'
node.normal['vagrant']['version'] = '1.88.88'
end.converge(described_recipe)
end

Expand Down
8 changes: 4 additions & 4 deletions spec/unit/recipes/windows_spec.rb
Expand Up @@ -17,14 +17,14 @@
include_context 'mock vagrant_sha256sum'

context 'with default attributes' do
VAGRANT_DEFAULT_VERSION = '1.8.5'.freeze
VAGRANT_DEFAULT_VERSION = '1.9.7'.freeze

cached(:windows_node) do
ChefSpec::SoloRunner.new(
platform: 'windows',
version: '2012R2'
) do |node|
node.set['vagrant']['msi_version'] = VAGRANT_DEFAULT_VERSION
node.normal['vagrant']['msi_version'] = VAGRANT_DEFAULT_VERSION
end.converge(described_recipe)
end

Expand All @@ -43,8 +43,8 @@
platform: 'windows',
version: '2012R2'
) do |node|
node.set['vagrant']['version'] = VAGRANT_OVERRIDE_VERSION
node.set['vagrant']['msi_version'] = VAGRANT_OVERRIDE_VERSION
node.normal['vagrant']['version'] = VAGRANT_OVERRIDE_VERSION
node.normal['vagrant']['msi_version'] = VAGRANT_OVERRIDE_VERSION
end.converge(described_recipe)
end

Expand Down

0 comments on commit a009942

Please sign in to comment.