Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- require 'pry'
- describe 'profile::ingester' do
- on_supported_os({
- supported_os: [
- {
- 'operatingsystem' => 'CentOS',
- 'operatingsystemrelease' => [
- '5',
- '6',
- '7'
- ]
- }
- ]
- }).each do |os, facts|
- context "on #{os}" do
- let(:facts) do
- facts.merge({
- puppetversion: Puppet.version,
- ap_env: 'dev',
- ap_region: 'us-east-1',
- role: 'ingester'
- })
- end
- role = facts[role]
- puts "My Role is #{role}"
- puts "My FactsRole is #{facts[role]}"
- puts "My FactsRole2 is #{facts[:role]}"
- scope = YAML.load('role: ingester')
- hiera = Hiera.new(:config => 'spec/fixtures/hiera.yaml')
- modules = hiera.lookup('nodejs::npm', "role/%{role}", scope)
- modules.each do |title, mod|
- mod_name = mod['package']
- mod_version = mod['ensure']
- context "with #{mod_name} (#{title}) set to #{mod_version}" do
- it { should contain_nodejs__npm(title).with_ensure(mod_version) }
- end
- end
- %w(profile::ingester).each do |puppet_class|
- it { is_expected.to contain_class(puppet_class) }
- end
- provider_class = Puppet::Type.type(:package).provider(:rpm)
- before :each do
- Puppet::Type.type(:package).stubs(:defaultprovider).returns(provider_class)
- end
- it { is_expected.to compile.with_all_deps }
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement