Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test rspec-puppet branch #33

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 5.4', :require => false
gem 'voxpupuli-test', :git => 'https://github.com/voxpupuli/voxpupuli-test.git', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 2.0', :require => false
gem 'rspec-puppet', :git => 'https://github.com/alexjfisher/rspec-puppet.git', :branch => 'include_legacy_facts'
end

group :development do
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@
mode => '0644',
content => $content,
}

notify { 'legacy_facts_check':
message => $facts['fqdn'],
}
}
8 changes: 8 additions & 0 deletions spec/classes/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/tmp/puppet-example').with_content('Hello World!') }

describe 'testing legacy facts pruning' do
if os_facts[:puppetversion].start_with?('8')
it { is_expected.to contain_notify('legacy_facts_check').without_message }
else
it { is_expected.to contain_notify('legacy_facts_check').with_message('foo.example.com') }
end
end
end
end
end