File: trusted_facts_lookup_spec.rb

package info (click to toggle)
ruby-rspec-puppet 4.0.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,444 kB
  • sloc: ruby: 6,377; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require 'spec_helper'

describe 'trusted_facts::lookup' do
  let(:node) { 'trusted.example.com' }

  context 'without trusted fact extensions' do
    it { is_expected.to run.with_params('certname').and_return(node) }
    it { is_expected.to run.with_params('hostname').and_return('trusted') }
    it { is_expected.to run.with_params('domain').and_return('example.com') }
    it { is_expected.to run.with_params('authenticated').and_return('remote') }
    it { is_expected.to run.with_params('extensions').and_return({}) }
  end

  context 'with trusted fact extensions' do
    let(:trusted_facts) do
      {
        'extra1' => '1',
        'extra2' => '2'
      }
    end

    it { is_expected.to run.with_params('extensions').and_return(trusted_facts) }
  end
end