File: server_facts_spec.rb

package info (click to toggle)
ruby-rspec-puppet 2.9.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,416 kB
  • sloc: ruby: 6,661; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'spec_helper'

describe 'server_facts', :if => Puppet::Util::Package.versioncmp(Puppet.version, '4.3.0') >= 0 do

  context 'with server_facts' do
    before do
      RSpec.configuration.trusted_server_facts = true
    end

    let(:facts) {
      {
        :ipaddress => '192.168.1.10'
      }
    }
    let(:node) { 'test123.test.com' }
    it { should contain_class('server_facts') }
    it { should compile.with_all_deps }
    it { should contain_notify("servername-test123.test.com") }
    it { should contain_notify("serverip-192.168.1.10") }
    it { should contain_notify("serverversion-#{Puppet.version}") }
    it { should contain_notify("environment-rp_env") }
  end
end