Skip to content

Commit

Permalink
MODULES-3211: fix broken strict_variable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 authored and jonnytdevops committed Mar 30, 2016
1 parent 3bdf98f commit d1a4d3b
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 13 deletions.
6 changes: 5 additions & 1 deletion manifests/dev.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
class apache::dev {
include ::apache::params

if ! defined(Class['apache']) {
fail('You must include the apache base class before using any apache defined resources')
}

$packages = $::apache::dev_packages
if $packages { # FreeBSD doesn't have dev packages to install
package { $packages:
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@
$docroot = '/var/www/localhost/htdocs'
$alias_icons_path = '/usr/share/apache2/icons'
$error_documents_path = '/usr/share/apache2/error'
$pidfile = undef
} elsif $::osfamily == 'Suse' {
$user = 'wwwrun'
$group = 'wwwrun'
Expand Down
2 changes: 2 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@
}

$_directories = [ merge($_directory, $_directory_version) ]
} else {
$_directories = undef
}

## Create a global LocationMatch if locations aren't defined
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/mod/dav_svn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:is_pe => false,
:is_pe => false,
}
end
it { is_expected.to contain_class("apache::params") }
Expand All @@ -52,7 +52,7 @@
:id => 'root',
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:is_pe => false,
:is_pe => false,
}
end
it { is_expected.to contain_class("apache::params") }
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/mod/dev_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require 'spec_helper'

describe 'apache::mod::dev', :type => :class do
let(:pre_condition) {[
'include apache'
]}

it_behaves_like "a mod class, without including apache"

[
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/mod/proxy_html_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:kernel => 'Linux',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:hardwaremodel => 'i386',
:is_pe => false,
:is_pe => false,
}
end

Expand Down
25 changes: 16 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@
shared_examples 'a mod class, without including apache' do
let :facts do
{
:id => 'root',
:lsbdistcodename => 'squeeze',
:kernel => 'Linux',
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:concat_basedir => '/dne',
:is_pe => false,
:id => 'root',
:lsbdistcodename => 'squeeze',
:kernel => 'Linux',
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:operatingsystemmajrelease => nil,
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:concat_basedir => '/dne',
:is_pe => false,
:hardwaremodel => 'x86_64',
}
end
it { should compile.with_all_deps }
end

RSpec.configure do |config|
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end

0 comments on commit d1a4d3b

Please sign in to comment.